所以我们有一个重置的 CSS 文件,它显然从我们的样式中剥离了阳光下的一切。
因此对于任何 OL LI,我必须在我们的 CSS 文件中明确声明:
#stupidDivTag ol li { list-style-type: decimal; }
所以当我有这个时:
<ol>
<li>One
<ol type="a">
<li>One Alpha</li>
</ol>
</li>
</ol>
但由于明确的声明,它似乎不起作用。
我不想使用内联样式,因为我们有成千上万的样式。
而且我不能使用其他明确的声明,例如:
#stupidDivTag ol li ol li { list-style-type: lower-alpha; }
因为其他嵌套列表不应该使用这种样式。
我在这里错过了什么?
是否需要为嵌套的 OL LI 创建一个类?
<ol class="nestedLowerAlpha">
最佳答案
使用直接子选择器:>
#stupidDivTag ol li /* all lis in stupid div tag are decimal */
{
list-style-type: decimal;
}
#stupidDivTag > ol > li > ol > li /* only second level li will be changed to lower alpha - assuming the first ol is a direct child of stupid div tag */
{
list-style-type: lower-alpha;
}
关于css - 嵌套的 OL LI 较低的 alpha 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31439955/