Is it necessary to use H2 after h1

六眼飞鱼酱① 提交于 2019-12-07 11:26:01

问题


Is it mandatory to use H2 after h1 if text is too small then can we use h4 after h1 . and is it accessible ?


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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)




回答5:


Yes, you can skip levels, and most screen readers won't care.

It is often better to use CSS, though.




回答6:


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).




回答7:


h1 and h2's are pretty vital to SEO, using one h1 and mutiple h2's after is the logical thing to do.



来源:https://stackoverflow.com/questions/1503522/is-it-necessary-to-use-h2-after-h1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!