如何覆盖pseudo ::/:: exterm element之前的pseudo ::的CSS内容属性?
这个问题并不是重复的,尽管对于某人来说,它可能看起来很仔细地阅读。
这不是关于CSS特异性的问题,也不是关于!重要指令(我不认为)。
我要学习的是:当使用(Unicode?)Fontawesome代码作为我的' content ' :: pseudo元素中的属性值时为项目列表设置基本自定义子弹, 仅通过更改“内容”值来更改每个子弹图标?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我解决的方式:
( codepen在这里)
,这是结果:
说明:
中间尝试:
工作解决方案:
接下来定义和样式的UL,该UL充当容器元素
样式li Elements
定义A 基本样式 字体很棒的图标子弹带有1REM余量和紫色的图标颜色,并将Square Facebook徽标设置为“内容” '使用:伪元素之前的值。注意:事实证明单身(:)正常工作(而不是::),尽管我不完全确定为什么
对于每个列表项目,我通过选择每个li applied class设置了子弹样式(电子邮件,portfolio,portfolio,等)仅更改内容属性值。
Here is how I solved this:
(Codepen here)
And here is the result:
Explanation:
Intermediate Attempts:
Working Solution Explanation:
First we define some CSS font awesome icon variables, but we don't use them. I could have just made this a multi-line comment, but I feel defining (unused) root variable makes my intentions clearer in this case.
Next define and style the ul which acts as a container element
Style the li elements
Define a base style for Font Awesome icon bullets with a 1rem margin and an icon color of purple and set the square Facebook logo as the 'content' value using :before pseudo element. NOTE: It turns out single colon (:) works perfectly (instead of ::), though I'm not entirely sure why
For each list item I set the bullet style by selection each li applied class (email, portfolio, etc.) changing the content property value only.