This question already has an answer here:
(这个问题在这里已有答案:)
Imagine a simple unsorted list with some <li>
items.
(想象一下带有一些<li>
项的简单未排序列表。)
Now, I have defined the bullets to be square shaped via list-style:square;
(现在,我已经通过list-style:square;
定义子弹为方形list-style:square;
)
However, if I set the color of the <li>
items with color: #F00;
(但是,如果我用颜色设置<li>
项目的color: #F00;
)
then everything becomes red! (一切都变红了!)
While I only want to set the color of the square bullets.
(虽然我只想设置方形子弹的颜色。)
Is there an elegant way to define the color of the bullets in CSS... (是否有一种优雅的方式来定义CSS中子弹的颜色......)
...without using any sprite images nor span tags! (...不使用任何精灵图像也不使用span标签!)
HTML
(HTML)
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<ul>
CSS
(CSS)
li{
list-style:square;
}
ask by Sam translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…