Is it mandatory to use H2 after h1 if text is too small then can we use h4 after h1 . and is it accessible ?
Technically you can use any combination of those.
Semantically, it's wise to use the common order. And if the font size is too small, use CSS to change that.
With the tags h1
-h6
you give a semantic meaning to a title. Where h1
is for the top level, h2
for a subdivision of h1
, h3
for a subdivision of h2
etc.
You can change the appearance by setting CSS rules, which is great because now you can separate content from layout.