Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 未从CSS中带入的图像_Html_Css_Anchor - Fatal编程技术网

Html 未从CSS中带入的图像

Html 未从CSS中带入的图像,html,css,anchor,Html,Css,Anchor,我正在尝试设置一个锚定标记,从页面的底部滚动到顶部,功能正常-但是我想要显示的箭头图标没有从链接的CSS中显示出来 HTML <a href="#" class="anchorScroll" style=""></a> 这是一个JS提琴,提前感谢任何人提供的任何帮助。您已经改变了这一点: content:url(https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg/20

我正在尝试设置一个锚定标记,从页面的底部滚动到顶部,功能正常-但是我想要显示的箭头图标没有从链接的CSS中显示出来

HTML

<a href="#" class="anchorScroll" style=""></a>
这是一个JS提琴,提前感谢任何人提供的任何帮助。

您已经改变了这一点:

content:url(https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg/200x200);
为此:

background:url('https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg');
将“内容”更改为“背景”,将链接放在Quotes上,并删除200x200

完整代码如下:

.anchorScroll {
        background:#8994a5 url('https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg');
        color: #fff;
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 9999;
        width: 40px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        font-size: 20px;
        border-radius: 3px;
    }

您需要从内容url链接中删除200x200,请参见下文

.anchorScroll{
内容:网址(https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg);
背景:8994a5;
颜色:#fff;
位置:固定;
底部:10px;
右:10px;
z指数:9999;
宽度:40px;
高度:40px;
线高:40px;
文本对齐:居中;
字体大小:20px;
边界半径:3px;
}

检查url。。。删除最后一个
/200x200
属性
内容:
必须与::before或::after一起使用,您无法将其直接应用于元素。您的图像url似乎不正确。感谢@gp对其进行了完美排序。多亏了delinear和KMSY,你还把背景颜色和背景图像放在了一起,这也是一个问题。上面的解决方案按照我的要求工作,但我最终使用了你的解决方案,因为我喜欢最终结果看起来更好。谢谢@Aslan Shemilov,很高兴它帮助了你。嘿,Maharkus,当我把背景颜色和背景图像放在一起时,你看到了什么问题?你能澄清一下吗?非常感谢。
.anchorScroll {
        background:#8994a5 url('https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg');
        color: #fff;
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 9999;
        width: 40px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        font-size: 20px;
        border-radius: 3px;
    }