gpt4 book ai didi

html - 包含号码的OL strip 化

转载 作者:行者123 更新时间:2023-11-28 10:37:42 28 4
gpt4 key购买 nike

我的 html 中有一个 ol 列表,上面有行条纹。看起来行条纹是从数字后面开始的。有没有办法让行条纹从数字开始?

我已经包含了正在发生的事情的片段

h4:nth-child(even) {
background-color: red;
}
<div class='panel-body'>
<ol>
<h4 class="people" style="font-family: sans-serif; display: block;">
<li>
<span class="name">One, O</span>
<span class="status" style="color: rgb(79, 133, 27);">Arrived</span>
<span class="time" style="width: 97px; max-width: 97px;">In Service</span>
</li>
</h4>

<h4 class="people" style="font-family: sans-serif; display: block;">
<li>
<span class="name">Two, T</span>
<span class="status" style="color: rgb(79, 133, 27);">Arrived</span>
<span class="time" style="width: 97px; max-width: 97px;">Next</span>
</li>
</h4>
<h4 class="people" style="font-family: sans-serif; display: block;">
<li>
<span class="name">thr, t</span>
<span class="status" style="color: rgb(79, 133, 27);">Arrived</span>
<span class="time" style="width: 97px; max-width: 97px;">1 hr 20 min</span>
</li>
</h4>
</ol>
</div>

最佳答案

当然,添加 list-style-position: inside规则:

h4:nth-child(even) {
background-color: red;
}
li {
list-style-position: inside;
}
<div class='panel-body'>
<ol>
<h4 class="people" style="font-family: sans-serif; display: block;">
<li>
<span class="name">One, O</span>
<span class="status" style="color: rgb(79, 133, 27);">Arrived</span>
<span class="time" style="width: 97px; max-width: 97px;">In Service</span>
</li>
</h4>

<h4 class="people" style="font-family: sans-serif; display: block;">
<li>
<span class="name">Two, T</span>
<span class="status" style="color: rgb(79, 133, 27);">Arrived</span>
<span class="time" style="width: 97px; max-width: 97px;">Next</span>
</li>
</h4>
<h4 class="people" style="font-family: sans-serif; display: block;">
<li>
<span class="name">thr, t</span>
<span class="status" style="color: rgb(79, 133, 27);">Arrived</span>
<span class="time" style="width: 97px; max-width: 97px;">1 hr 20 min</span>
</li>
</h4>
</ol>
</div>

关于html - 包含号码的OL strip 化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36040412/

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