gpt4 book ai didi

html - 在 html 中格式化 ol 列表计数

转载 作者:太空宇宙 更新时间:2023-11-04 15:15:50 24 4
gpt4 key购买 nike

如何使用 css 仅格式化 list-index 的背景?

<ol style="list-style-type:decimal">
<li>Tagesordnung</li>
<li>Pause</li>
<li>Vorbesprechung</li>
<li>Mittagessen</li>
<li>Vortrag zum Thema "Komme nie zu fr&uuml;h zur Sache!"</li>
<li>Pause</li>
<li>Gem&uuml;tlicher Ausklang</li>
</ol>

最佳答案

使用 css list-style-position: outside; 就够了吗?

HTML 代码的 CSS:

ol{
background-color: red;
list-style-position: outside;
}
ol li{
background-color: white;
}


这是 jsfiddle 示例。
http://jsfiddle.net/RGKnu/1/

附言如果你想要 f.e.您可以将 text-indent css 属性与 li 选择器一起使用,从而在背景和列表项文本之间留出更多空间。

关于html - 在 html 中格式化 ol 列表计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15270710/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com