【问题标题】:How to remove indents from list items [duplicate]如何从列表项中删除缩进[重复]
【发布时间】:2018-07-26 19:36:39
【问题描述】:

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

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

【问题讨论】:

  • 哪些缩进?您有无序列表,其中每个元素都以标记开头。如果您不想要它们,请使用list-style-type: none;。这是基本信息,你可以在任何地方找到它,首先使用 google 或 w3。
  • 是的,我用过。但是,它似乎在保存后被剥离。可能是我使用的富文本编辑器的问题。

标签: html list text-indent


【解决方案1】:

您可以使用几行 CSS(在 style sheet 中)来完成:

.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>

【讨论】:

    猜你喜欢
    • 2012-12-06
    • 1970-01-01
    • 2011-02-20
    • 2019-12-07
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 2014-09-30
    • 1970-01-01
    相关资源
    最近更新 更多