Is it alright to use multiple h1 tags on the same page, but style them differently?

前端 未结 11 1361
走了就别回头了
走了就别回头了 2020-12-02 15:38

I have a webpage that I use h1 tags multiple times within various DIVs and I style h1 for each div to be the appropriate size.

For example...

#conten         


        
相关标签:
11条回答
  • 2020-12-02 15:53

    I don't like the idea of multiple H1s. H1 is the top level, most important heading and the page will basically be about that topic. If you have an equally important second topic, don't put it in another H1 tag, just put it in another page. It deserves that, right?

    0 讨论(0)
  • 2020-12-02 15:57

    Just remember that your h1s are used to indicate context, not layout. So, there's nothing inherently wrong with having several on a page.

    In this specific example, you need to decide if your left-nav h1s have the same contextual importance as your content h1s and your recent-news h1s. If a clear hierarchy exists in your mind, use your header tags to demonstrate it.

    0 讨论(0)
  • 2020-12-02 15:57

    In general, you should only have one h1 per page, and that h1 should succintly represent the content on that page. As long as you are willing to style with CSS, find out which level of headings (h2, h3, h4, etc) that properly represent the headings you want to use, and then style them instead.

    0 讨论(0)
  • 2020-12-02 16:00

    It all depends a bit on what your doctype is. With html5 it's OK to use multiple h1 tags per section. (don't read, per <section></section>!) When using in example the XHTML 1.0 Transitional doctype, I'd avoid using multiple h1 tags on a single page.

    When using in example the XHTML 1.0 Transitional doctype, I'd often go for something like this:

    • h1 : max. one time per page
    • h2 : max. two times per page
    • etc.

    Also @joel, even though your answer is sort of OK, please don't try to confuse anyone... I can say I'm a Google software engineer, because I simply work with Google (not the company, but the product) AND I'm an engineer... Please list your company name AND any certifications when claiming things as such.

    0 讨论(0)
  • 2020-12-02 16:01

    I try to have only one H1 on the page and have it almost but slightly re-arranged from the content of the title tag / H1 is the the main idea of an individual page every thing else should be an h2 tag and Lower....

    0 讨论(0)
  • 2020-12-02 16:01

    If it is regarding seo it's better to use h1 tags And If you want to use it for just sytling purpose use css stylesheets.

    The most important is that: If more then one h1 tag is used in a webpage then google may consider that page as spam. use can other heading tags other than h1 like h2 h3 h4 h5 h6 any number of times.

    0 讨论(0)
提交回复
热议问题