我正在尝试获取自定义的有序列表来处理段落和其他容器,但我无法使列表的行为与默认值相同。
具体来说,我希望有一个自定义列表和分段内容,它们与枚举显示在同一行。另外,我正在寻找一种更改列表而不是段落的解决方案。该段落只是我不想更改的一些生成内容的示例。
.custom {
list-style-type: none;
counter-reset: elementcounter;
}
.custom li:before {
content: counter(elementcounter) ". ";
counter-increment: elementcounter;
}
.solution {
list-style-type: none;
counter-reset: elementcounter;
}
.solution li>p {
display: inline-block;
}
.solution li:before {
content: counter(elementcounter) ". ";
counter-increment: elementcounter;
}
<ol>
<li><p>Places nicely on the same line.</p></li>
<li><p>Places nicely on the same line.</p> <p>Places nicely on the same line.</p></li>
</ol>
<!-- Original problem
<ol class="custom">
<li><p>Places poorly on the second line.</p></li>
<li><p>Places poorly on the second line.</p> <p>Places nicely on the second line.</p></li>
</ol>
-->
<ol class="solution">
<li><p>Places poorly on the second line.</p></li>
<li><p>Places poorly on the second line.</p> <p>Places poorly on the same line.</p></li>
</ol>
30秒到达战场
相关分类