简体   繁体   English

摆脱单个项目的子弹

[英]Getting rid of a bullet for a single item

I have a bullet list and I want just a single item without a bullet.我有一个项目符号列表,我想要一个没有项目符号的项目。 How do I do that?我怎么做? For example, in the following, can I get the "Cheese" with no bullet:例如,在下面,我可以得到没有子弹的“奶酪”:

<ol>
  <li>Milk</li>
  <li>Cheese</li>
  <li>Goats</li>
</ol>

Many good SO threads deal with changing the entire list, but I'm interested in a specific item.许多优秀的 SO 线程处理更改整个列表,但我对特定项目感兴趣。

You can just target any of the list items with class or pseudo selectors您可以使用类或伪选择器来定位任何列表项

Example below shows this using first-child and class下面的示例使用 first-child 和 class 显示了这一点

 li:first-child, .no-bullet { list-style: none; }
 <ol> <li>Milk </li> <li class="no-bullet">Cheese </li> <li>Goats </li> </ol>

The solution would be解决办法是

ol > li:nth-child(2) {
   list-style: none;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM