简体   繁体   English

我该如何复制 <ol><li> HTML中的项目符号列表带有正确对齐的缩进?

[英]How can I replicate a <ol><li> bullet list in HTML with indents that line up correctly?

I need an HTML alphabetical bulleted list which will be used quite frequently. 我需要一个HTML字母项目符号列表,该列表会经常使用。 This is something that is not supported with Google sites, which I use all the time for work...can you manually replicate a HTML bulleted list? Google网站不支持此功能,我一直都在工作。...您可以手动复制HTML项目符号列表吗?

So far my indents don't match up because I am using fixed margins and the alphabetical characters all have unique dimensions in pixels: 到目前为止,我的缩进不匹配,因为我使用的是固定边距,并且字母字符都具有唯一的像素尺寸:

 <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> 

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

Ordered Lists already supports various methods for how the list is defined (Numbers, alphabet, roman numerals, etc). 顺序列表已经支持各种定义列表的方法(数字,字母,罗马数字等)。 This can also be modified using CSS list-style-type . 也可以使用CSS list-style-type进行修改。

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

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

Since Google Sites have some limitations, I'm not sure if you're using a HTML Box or editing the HTML source of the Google Page, but you can use the HTML style attribute with following syntax: 由于Google协作平台有一些限制,因此我不确定您是使用HTML Box还是编辑Google Page的HTML源 ,但是可以使用具有以下语法的HTML style attribute

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM