![](/img/trans.png)
[英]CSS ordered list - style the number, when li contains multiple lines, maintaining indentation
[英]Using psuedo elements for the style of an ordered list, while preserving indentation
我遇到了CMS正在生成表单列表的情况
<ul>
<li>
<a>Here's list item 1, which will wrap onto the next next due to the size of the ul element containing it</a>
</li>
<li>
<a>Here's list item 2, which will wrap onto the next next due to the size of the ul element containing it</a>
</li>
<li>
<a>Here's list item 3, which will wrap onto the next next due to the size of the ul element containing it</a>
</li>
</ul>
并且我需要客户希望列表样式为'>'
字符,并且颜色与文本不同。 因此,我决定使用经典的伪元素hack,但是现在的问题是,我希望文本在换行到下一行时能够对齐,就像在普通列表中一样。 我似乎尝试了li
和li:before
元素的padding / text-indent / margin的每种组合,但无法正确完成。
这是方案的一个小提琴:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.