如何在 <ol><li> HTML 中复制具有正确排列的缩进的项目符号列表?



我需要一个HTML字母项目列表,这将经常使用。这是谷歌网站不支持的,我一直用它来工作……您可以手动复制HTML项目符号列表吗?

到目前为止,我的缩进不匹配,因为我使用了固定的边距,而且字母字符都有独特的像素尺寸:

<div style="display:inline">
<b style="text-align:left">Enter your list title here</b>
<span style="display:block;margin-left:40px"> 
<p style="font-size:0.85em;font-weight:normal"><b style="margin-right:1em">a.</b>Enter your list description here</p>
<p style="font-size:0.85em;font-weight:normal"><b style="margin-right:1em">b.</b>Enter your list description here</p>
<p style="font-size:0.85em;font-weight:normal"><b style="margin-right:1em">c.</b>Enter your list description here</p>
<p style="font-size:0.85em;font-weight:normal"><b style="margin-right:1em">d.</b>Enter your list description here</p>
<p style="font-size:0.85em;font-weight:normal"><b style="margin-right:1em">e.</b>Enter your list description here</p>
<p style="font-size:0.85em;font-weight:normal"><b style="margin-right:1em">f.</b>Enter your list description here</p>
<p style="font-size:0.85em;font-weight:normal"><b style="margin-right:1em">g.</b>Enter your list description here</p>
</span>
</div>

由于Google站点有一些限制,我不确定您是否正在使用HTML框或编辑Google页面的HTML源,但您可以使用HTML style attribute与以下语法:

<ol style="list-style-type:lower-alpha">
  <li>item1</li>
  <li>item2</li>
  <li>item3</li>
  <li>item4</li>
</ol>

<ol type="a">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
</ol>

Ordered Lists已经支持定义列表的各种方法(数字、字母、罗马数字等)。这也可以使用CSS list-style-type进行修改。

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol

https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type

最新更新