簡體   English   中英

如何在 HTML 中縮進列表

[英]How to indent list in HTML

在創建縮進列表時我遇到了一個小問題。 我想發布 html 並請人幫助了解 css 應該是什么。

基本上它應該說鏈接“這是一個非常簡單的過程”,這不應該有要點,它只是一個句子。

然后在該行下方(之間沒有空格),有序列表應縮進。

這該怎么做?

 <ul class="nobullet"> <li>It's a very simple process: <ol> <li>Send an email to <b>xxx@xxx.com</b> requesting to join our talent pool along with your CV attached.</li> <li>We will send you a form to complete where you can state your preferred roles and locations.</li> <li>You relax and we will communicate with our business clients on a weekly basis for available roles.</li> <li>We will send you job specifications that match your preference.</li> </ol> </li> </ul>

不確定縮進.. 你的意思是你想要 1,2,3 也縮進?

對於要點,只需將"list-style-type: none"添加到 css 中的 class。

 .nobullet{ list-style-type: none; }
 <ul class="nobullet"> <li>It's a very simple process: <ol> <li>Send an email to <b>xxx@xxx.com</b> requesting to join our talent pool along with your CV attached.</li> <li>We will send you a form to complete where you can state your preferred roles and locations.</li> <li>You relax and we will communicate with our business clients on a weekly basis for available roles.</li> <li>We will send you job specifications that match your preference.</li> </ol> </li> </ul>

或許可以考慮改成 HTML 吧。 如果“這是一個非常簡單的過程: ”不是要點,則只需將其更改為<h3><h4>即可。 你也需要考慮可訪問性......

 <h3>It's a very simple process:</h3> <ol> <li>Send an email to <b>xxx@xxx.com</b> requesting to join our talent pool along with your CV attached.</li> <li>We will send you a form to complete where you can state your preferred roles and locations.</li> <li>You relax and we will communicate with our business clients on a weekly basis for available roles.</li> <li>We will send you job specifications that match your preference.</li> </ol>

你打算在你的無序列表中加入更多的<li>元素嗎?

**只是放

把這個文本:這是一個非常簡單的過程 -> 在 h1 標簽或任何

代替列表標簽

它不需要這個標簽**

在css中添加:

列表樣式:無;

您可以使用list-style-type屬性更改標記。

ul.nobullet {
  list-style-type: none;
}

如果要更改縮進,可以使用填充和邊距值。 在設置列表縮進樣式時,我喜歡為列表和列表項元素同時設置 padding-left 和 margin-left 以確保根據需要設置 padding 和 margin 的縮進(我不確定所有瀏覽器都縮進他們的列表具有相同的屬性)。 這將使所有列表縮進 4 em:

ul, 0l {
  margin-left: 0;
  padding-left: 4em;
}
li {
  margin-left: 0;
  padding-left: 0;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM