gpt4 book ai didi

html - 图像未从 CSS 继承

转载 作者:行者123 更新时间:2023-11-28 15:13:42 24 4
gpt4 key购买 nike

我正在尝试设置一个 anchor 标记以从页面底部滚动到页面顶部,并且该功能工作正常 - 但我想要显示的箭头图标没有从链接的 CSS 中显示出来。

HTML

<a href="#" class="anchorScroll" style=""></a>

CSS

/*Anchor to move to top*/

.anchorScroll {
content:url(https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg/200x200);
background: #8994a5;
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;
}

这是一个 JS Fiddle link.提前感谢任何人可以提供的任何帮助。

最佳答案

你已经改变了这个:

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

为此:

background:url('https://visualpharm.com/assets/98/Upward%20Arrow-595b40b85ba036ed117dbd06.svg');

将“内容”更改为“背景”,放置引文链接,并删除 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;
}

关于html - 图像未从 CSS 继承,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47773039/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com