我已设置以下内容以在<li>
项
li { list-style: circle; color: #fcbf00; }
然而,它并没有显示颜色。我该如何解决这个问题?
发布链接以显示我的完整CSS:http://pastebin.com/1h7YyGqW
答案 0 :(得分:0)
由于使用*
选择器进行边距设置,您无法看到子弹。
在正文容器中添加填充或边距,或将list-style-position
设置为inside
.ul1 li {
list-style: circle outside;
color: red;
}
.ul2 li {
list-style: circle inside;
color: green;
}
.ul3 {
padding: 0 2em;
}
.ul3 li {
list-style: circle outside;
color: blue;
}
* {
margin: 0;
padding: 0;
}
body {width: 200px;}
<h2>Outside list</h2>
<ul class="ul1">
<li>Lorem ipsum dolor sit amet, consectetur.</li>
<li>Id nesciunt, provident! Ullam, voluptate, ipsum!</li>
<li>Blanditiis voluptatibus deleniti amet. Assumenda, praesentium.</li>
</ul>
<h2>Inside list</h2>
<ul class="ul2">
<li>Lorem ipsum dolor sit amet, consectetur.</li>
<li>Voluptates tempora laudantium saepe voluptas placeat.</li>
<li>Harum accusamus nihil consequuntur, hic repudiandae.</li>
</ul>
<h2>Outside list with padding</h2>
<ul class="ul3">
<li>Lorem ipsum dolor sit amet, consectetur.</li>
<li>Molestiae saepe minus, quod officia ducimus.</li>
<li>Omnis nisi excepturi nobis neque. Unde.</li>
</ul>
答案 1 :(得分:0)