.myClass .dropdown-menu > li {
border-bottom: 1px solid;
margin-left: 5px;
}
这会在我的列表中的每个列表项下方设置边框。 margin 缩进文本而不是边框。有没有办法实现这一点,因为我希望我的边框缩进为文本。现在看起来像这样:
-----
text
-----
text
我想要
----
text
----
text
.myClass .dropdown-menu {
border-bottom: 1px solid;
margin-left: 5px;
}
边距缩进文本和边框,但正如我之前所说,我只需要缩进边框,让文本缩进保持原样。
HTML:
<ul class="dropdown-menu">
<li>Item 1 </li>
<li>Item 2 </li>
</ul>
最佳答案
您需要使用 text-decoration: underline;
或 text-decoration:overline;
取决于您需要如何强调文本
有了这个决定当文本出现下划线时自动拉伸(stretch)整个文本长度
关于html - CSS - 无序列表中的缩进边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23928078/