我需要增加小数和有序列表的文本之间的间距,但我使用DL而不是OL元素。HTML数字和文本之间的列表项间距
随着:: before元素的margin-right我可以调整间距。
HTML
<dl>
<dt>Blah blah blah</dt>
<dd>Test test</dd>
<dt>Blah blah blah</dt>
<dd>Test test</dd>
<dt>Blah blah blah</dt>
<dd>Test test</dd>
</dl>
CSS
dl {
list-style: decimal inside;
}
dt {
font-size: 1.2em;
border-bottom: 1px solid #444;
}
dt::before {
display: list-item;
content: ' ';
float: left;
margin-right: 20px;
}
dt:not(:first-of-type) {
margin-top: 10px
}
这里是什么,我试过的jsfiddle。间距工作,但列举不正确。 我在做什么错?
这个完美的作品!非常感谢 –