首页 > 解决方案 > 如何从列表项中删除缩进

问题描述

这是我的代码。如何从列表项中删除缩进?代码去哪儿了?

<ul>
    <li>The comment</li>
    <li>The product(s) involved</li>
    <li>The source of comment</li>
</ul>

标签: htmllisttext-indent

解决方案


您可以使用几行 CSS(在样式表中)来完成:

.nobullets {
  list-style-type: none;
  padding: 0;
  margin: 0; /* Optional */
}
<ul class="nobullets">
<li>The comment</li>
<li>The product(s) involved</li>
<li>The source of comment</li>
</ul>


推荐阅读