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 fontsize is too small, use css to change that.
With the tags h1..h6 you give a semantical meaning to a title. Where h1 is for the toplevel, h2 for a subdivision of h1, h3 for a subdivision of h2 etc..
You can change the apearance by setting CSS rules. Which is great because now you can separate content from lay-out.
Ideally you should stick to H1 then H2 and then use CSS to alter the styles of both to match what you want.
Think of HTML as describing the content and structure of your document (hence why it's preferred to stick to H1 then H2, because that indicates the structure of the headings), and then think of CSS as taking that structure and formatting it according to some layout rules, so the CSS defines how big and what colour your want all your H1s and H2s to be.
(Technically there is nothing stopping your from mixing up the order and doing whatever you want though)
You should always structure the document correctly, so yes it should be h2
after h1
- if the text is the wrong size, you should use CSS to style the headings to your taste.
Yes, you can skip levels, and most screen readers won't care.
It is often better to use CSS, though.
H1 is usally used for primary headers, h2 for subheaders, h3 for subsubheaders etc. It's doesn't really matter what order you use them in. it's just a conventional document structure, it would illogical to have a sub header, then a primary header but it's not enforced. Just style them in css for your liking.
No, they're just tags. The heirarchy is implied rather than defined or enforced so you can use them in any order you please.
But for readability and neatness you're better of redefining them with CSS if you don't like the sizes rather than just using H3 for a main heading and ignoring H1 and H2. Aside from anything else it could impact Search Engine Optimisation (which considers H1 significant, though I'm not sure about H2 and H3).