Html 从 li 和 ul 中去除黑点
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36350948/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Removing black dots from li and ul
提问by ProRacer420
Im working on a project and im using some ul and li's.
我正在做一个项目,我正在使用一些 ul 和 li。
But i cant seem to figure out how to remove those pesky black dots that come with those lists.
但我似乎无法弄清楚如何删除那些列表中那些讨厌的黑点。
Can any of you help me with this?
你们中的任何人都可以帮我解决这个问题吗?
Edit: i completely forgot to search this site if there was already an answer (derp) turns out there was! Marked this as a duplicate, thanks for helping me everyone!
编辑:如果已经有答案(derp),我完全忘记搜索这个网站了!将此标记为重复,感谢大家帮助我!
回答by D.Freeman
Those pesky black dots you are referencing to are called bullets.
您所指的那些讨厌的黑点称为子弹。
They are pretty simple to remove, just add this line to your css:
删除它们非常简单,只需将此行添加到您的 css 中:
ul {
list-style-type: none;
}
Hope this helps
希望这可以帮助
回答by Cristiano Perdig?o
There you go, this is what I used to fix your problem:
好了,这就是我用来解决您的问题的方法:
CSS CODE
代码
nav ul { list-style-type: none; }
HTML CODE
代码
<nav>
<ul>
<li><a href="#">Milk</a>
<ul>
<li><a href="#">Goat</a></li>
<li><a href="#">Cow</a></li>
</ul>
</li>
<li><a href="#">Eggs</a>
<ul>
<li><a href="#">Free-range</a></li>
<li><a href="#">Other</a></li>
</ul>
</li>
<li><a href="#">Cheese</a>
<ul>
<li><a href="#">Smelly</a></li>
<li><a href="#">Extra smelly</a></li>
</ul>
</li>
</ul>
</nav>