[英]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>
元素嗎?
**只是放
它不需要這個標簽**
在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.