我创建了一个无序列表。我觉得无序列表中的项目符号很烦人,所以我想删除它们。

有可能有一个没有项目符号的列表吗?


当前回答

我试着观察到:

header ul {
   margin: 0;
   padding: 0;
}

其他回答

您需要使用列表样式:none;

<ul style="list-style: none;">
    <li>...</li>
</ul>
 <div class="custom-control custom-checkbox left">
    <ul class="list-unstyled">
        <li>
         <label class="btn btn-secondary text-left" style="width:100%;text-align:left;padding:2px;">
           <input type="checkbox" style="zoom:1.7;vertical-align:bottom;" asp-for="@Model[i].IsChecked" class="custom-control-input" /> @Model[i].Title
         </label>
        </li>
     </ul>
</div>

如果您使用Bootstrap,它有一个“未样式”类:

删除列表项的默认列表样式和左填充(仅限直接子项)。

引导2:

<ul class="unstyled">
   <li>...</li>
</ul>

http://twitter.github.io/bootstrap/base-css.html#typography

引导3和4:

<ul class="list-unstyled">
   <li>...</li>
</ul>

引导3:http://getbootstrap.com/css/#type-列表

引导4:https://getbootstrap.com/docs/4.3/content/typography/#unstyled

引导5:https://getbootstrap.com/docs/5.0/content/typography/#unstyled

要完全删除ul默认样式:

    list-style-type: none;

    margin: 0;
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
    padding-inline-start: 0;

在BOOTSTRAP中,可以通过在li标记的父类上设置列表未设置样式的类来删除项目符号。

<ul className="list-unstyled">
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
</ul>