在 ol li 列表中看不到数字
Can't see numbers in ol li list
我在一个网站上有一些编号列表,其中包含我目前正在开发的 wordpress 模板。但是,我看不到编号列表前的数字。
我已经将 list-style-type: decimal
设置为 ol > li 并尝试了一些其他操作,但 none 似乎有效。
有人可以帮助我吗? (这可能是一个非常明显的错误,但我不知道该怎么做)
谢谢!
尝试使用
ul {
list-style-position: inside;
}
试试这个:list-style-type: decimal !important;
请谨慎使用。
您已在此处关闭
.wrapper .entry-content ol {
list-style-type: none;
}
您需要重新开启它们。
.wrapper .entry-content ol {
list-style-type: decimal;
}
您没有在单个 li
上设置 list-style-type
,而是在包含 ol
或 ul
上设置 list-style-type
。
在您的 CSS 中,您正在设置:
.wrapper .entry-content ol {
list-style-type: none;
margin: 0;
}
当列表样式需要向左填充 25 像素时,您还在 CSS 中进一步重置填充。
试试这个:
.wrapper .entry-content ol {
list-style-type: decimal;
margin: 0;
padding-left: 25px;
}
我做了一个小测试页:
<html>
<head>
<title>Test Page</title>
</head>
<body>
<ul>
<li>ul no style</li>
<li>test</li>
</ul></br>
<ul style="list-style-type: decimal">
<li>ul with style</li>
<li>test</li>
</ul></br>
<ol style="list-style-type: decimal">
<li>ol with style</li>
<li>test</li>
</ol></br>
<ol>
<li>ol without style</li>
<li>test</li>
</ol>
</body>
</html>
如您所见,无需为 ordered list
设置样式。
如果您想要数字,您可以 不 包含样式并使用 <ol></ol>
标签。
我在一个网站上有一些编号列表,其中包含我目前正在开发的 wordpress 模板。但是,我看不到编号列表前的数字。
我已经将 list-style-type: decimal
设置为 ol > li 并尝试了一些其他操作,但 none 似乎有效。
有人可以帮助我吗? (这可能是一个非常明显的错误,但我不知道该怎么做)
谢谢!
尝试使用
ul {
list-style-position: inside;
}
试试这个:list-style-type: decimal !important;
请谨慎使用。
您已在此处关闭
.wrapper .entry-content ol {
list-style-type: none;
}
您需要重新开启它们。
.wrapper .entry-content ol {
list-style-type: decimal;
}
您没有在单个 li
上设置 list-style-type
,而是在包含 ol
或 ul
上设置 list-style-type
。
在您的 CSS 中,您正在设置:
.wrapper .entry-content ol {
list-style-type: none;
margin: 0;
}
当列表样式需要向左填充 25 像素时,您还在 CSS 中进一步重置填充。
试试这个:
.wrapper .entry-content ol {
list-style-type: decimal;
margin: 0;
padding-left: 25px;
}
我做了一个小测试页:
<html>
<head>
<title>Test Page</title>
</head>
<body>
<ul>
<li>ul no style</li>
<li>test</li>
</ul></br>
<ul style="list-style-type: decimal">
<li>ul with style</li>
<li>test</li>
</ul></br>
<ol style="list-style-type: decimal">
<li>ol with style</li>
<li>test</li>
</ol></br>
<ol>
<li>ol without style</li>
<li>test</li>
</ol>
</body>
</html>
如您所见,无需为 ordered list
设置样式。
如果您想要数字,您可以 不 包含样式并使用 <ol></ol>
标签。