How to add section numbers (1.2, 3.4.1) automatically using CSS?

后端 未结 2 1609
感动是毒
感动是毒 2021-02-15 16:05

How to add section numbers (1.2, 3.4.1) automatically using CSS?

I currently have

h1, h2, h3, h4 {
  font-weight: normal;
}
h1 { font-size: 140%; }
h2 {          


        
2条回答
  •  后悔当初
    2021-02-15 16:25

    To answer the question if “I only have an h2, how do I suppress the leading 1., alter the h2:before style selector so the h2 must follow the h1 :

    h1:before > h2:before {
       // your h2 attributes go here
    } 
    

提交回复
热议问题