我为列表定义了一个全局变量,并在我的html中引用了
ol>li::before, ul>li::before {
color: #FFFFFF;
content: '\00A7';
display: inline-block;
position: absolute;
}
我正在尝试在html中覆盖它,因为我必须删除此行:
content: '\00A7';
如果我只是在本地文件中使用它,它不会被覆盖。关于如何解决此问题的任何建议?
您有三种方法可以实现。
!important
ol>li::before, ul>li::before {
content: '\00A7' !important;
}
<link rel="stylesheet" href="global.css">
<link rel="stylesheet" href="my.css">
<ol my-tag>
...
</ol>
ol[my-tag]>li::before{
// your own css
}