我创建了一个无序列表。我觉得无序列表中的项目符号很烦人,所以我想删除它们。
有可能有一个没有项目符号的列表吗?
我创建了一个无序列表。我觉得无序列表中的项目符号很烦人,所以我想删除它们。
有可能有一个没有项目符号的列表吗?
当前回答
如果您使用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>)的CSS上将列表样式类型设置为none来删除项目符号,例如:
ul {
list-style-type: none;
}
如果还想删除缩进,您可能还需要在其中添加填充:0和边距:0。
有关列表格式技术的详细演练,请参见Listutorial。
您需要使用列表样式:none;
<ul style="list-style: none;">
<li>...</li>
</ul>
如果您使用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
<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>
ul{list-style-type:none;}
只需将无序列表的样式设置为无。