Html 有序列表项前面有数字和正方形
我没有找到解决这个问题的办法。我的有序列表项有一个前导数字和一个黑色正方形。我希望它们只有一个前导数字,并消除黑色正方形。可能还有另一个更高级别的样式表控制Html 有序列表项前面有数字和正方形,html,css,styles,html-lists,Html,Css,Styles,Html Lists,我没有找到解决这个问题的办法。我的有序列表项有一个前导数字和一个黑色正方形。我希望它们只有一个前导数字,并消除黑色正方形。可能还有另一个更高级别的样式表控制li的外观,但我想用本地内联样式覆盖它 HTML: …结果:只有正方形 ol{ list-style-type:decimal; list-style:none; } li{ list-style:none; list-style-type:none; } ol{ list-style-type:decimal; list-style:de
li
的外观,但我想用本地内联样式覆盖它
HTML:
…结果:只有正方形
ol{
list-style-type:decimal;
list-style:none;
}
li{
list-style:none;
list-style-type:none;
}
ol{
list-style-type:decimal;
list-style:decimal;
}
li{
list-style-type:decimal;
list-style:none;
}
ol{
list-style-type:decimal;
list-style:decimal;
}
li{
list-style-type:decimal;
list-style:decimal;
}
…结果:只有正方形
ol{
list-style-type:decimal;
list-style:none;
}
li{
list-style:none;
list-style-type:none;
}
ol{
list-style-type:decimal;
list-style:decimal;
}
li{
list-style-type:decimal;
list-style:none;
}
ol{
list-style-type:decimal;
list-style:decimal;
}
li{
list-style-type:decimal;
list-style:decimal;
}
…结果:只有正方形
ol{
list-style-type:decimal;
list-style:none;
}
li{
list-style:none;
list-style-type:none;
}
ol{
list-style-type:decimal;
list-style:decimal;
}
li{
list-style-type:decimal;
list-style:none;
}
ol{
list-style-type:decimal;
list-style:decimal;
}
li{
list-style-type:decimal;
list-style:decimal;
}
…结果:数字和正方形
<ol>
<li class="maintenance">Light all of the blah blah blah.</li>
<li class="maintenance">Close the hood and blah blah blah.</li>
<li class="maintenance">Turn off the blah blah blah.</li>
<li class="maintenance">Once the grill has blah blah blah.</li>
</ol>
我还尝试了一个特定的伪类(我认为这是正确的术语):
……等等。仍然生成前导数字和正方形
<ol>
<li class="maintenance">Light all of the blah blah blah.</li>
<li class="maintenance">Close the hood and blah blah blah.</li>
<li class="maintenance">Turn off the blah blah blah.</li>
<li class="maintenance">Once the grill has blah blah blah.</li>
</ol>
点亮所有这些废话
关闭发动机罩并诸如此类
关掉这些废话
一旦烤架上有什么废话
更新:
显然,在主样式表中,{content:■"; }代码>
我在本地内联样式中添加了
li:before{content:}
,这样就去掉了方块。多亏了JoshC。可能有一个:before
伪元素导致了方块
删除它,或添加以下内容:
li:before {
content:"";
}
我无法重现这一点。可能是其他HTML/CSS导致了这一点。可能是
:在伪元素导致这一点之前?请尝试在devlooper工具中检查元素,看看哪些样式由哪些类应用。也许你有一个样式集在食物链的某个更高位置设置为!重要。@JoshC,你是完全正确。我刚刚在{content:;}
之前加了一个li:方格,方格消失了。谢谢!我会尽快检查这个答案是否正确。