我需要的是什么:要加下划线的列表项和与项目符号不同的颜色,不应加下划线
我尝试了什么:
我的问题是http://jsfiddle.net/g7fgy70c/
HTML (无法更改此结构,因为我正在使用CMS)
<ul>
<li><a hfref="http://www.google.com">This should be underlined, but the bullet before it should not be</a></li>
<li><a hfref="http://www.google.com">This should be underlined, but the bullet before it should not be</a></li>
<li><a hfref="http://www.google.com">This should be underlined, but the bullet before it should not be</a></li>
</ul>
CSS
ul
{
list-style-type: none;
}
a
{
text-decoration: underline;
}
li > a:before
{
content: "\002022";
color: red;
padding-right: 5px;
/* text-decoration: none; DOES NOT WORK, THE BULLETS ARE STILL UNDERLINED */
}
答案 0 :(得分:1)
目标li not li&gt; a:http://jsfiddle.net/g7fgy70c/3/
li:before
{
content: "\002022";
color: red;
padding-right: 5px;
}