特定の形式でネストされた順序付きリストを作成するスマートな方法を探していました。
1. text
2. text
2.1 text
2.2 text
2.3 text
3. text
4. text
4.1 text
4.2 text
4.3 text
5. text
そこでタイプ atrib を使用しようとしましたが、どこにも行きませんでした。インデントは必要ありません....しかし、それはいいでしょう...
前もって感謝します:D
そのためにカウンターを使用する
OL { counter-reset: item }
LI { display: block }
LI:before { content: counters(item, ".") " "; counter-increment: item }
実際の HTML をもっと見る必要があります。CSS を使用すると、この種の番号付け (副次節) を実現できます。
ol.main > li {
counter-increment: root;
}
ol.main > li > ol {
counter-reset: subsection;
list-style-type: none;
}
ol.main > li > ol > li {
counter-increment: subsection;
}
ol.main > li > ol > li:before {
content: counter(root) "." counter(subsection) " ";
}