Forum Moderators: phranque

Message Too Old, No Replies

Do you have two <h1s> - site title and page title?

         

londrum

9:02 pm on May 24, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I’m just doing a big redesign from scratch and its come up that some people have two <h1s> on every page - one for the site name (which is identical on every page), followed by the actual page title.

I’ve only ever done the page title, but i suppose technically theres nothing wrong with having two because they are both genuine titles. But wouldnt it take away from the actual subject of the page?

Im not sure its such a good idea

not2easy

9:57 pm on May 24, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Might a logo image be used in place of the site title? I seldom see the site title on every page but I have seen it that way on information sites, as branding.

phranque

11:00 pm on May 24, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



regarding compliance with html5 standards, the short answer is that you can have a <h1> header in each section since each section can have its own document outline.
you should read the Section page of the HTML Living Standard [html.spec.whatwg.org] - especially the "Headings and outlines" section.

tangor

1:53 am on May 25, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use page sections to divide up the locations where you can put ONE h1 in each.

Logo
Title
Docbody

You can include h1 into captions as well.

Just avoide TWO h1s in any section or caption!

Marshall

11:58 am on May 25, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you you using the <h1> tags for the purpose they were designed or for styling? If it is the latter, then you should CSS.

londrum

6:17 am on May 26, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well to be honest, I was thinking of including two for SEO reasons. The site title would be in the <header> and the other probably in the <article>

tangor

7:13 am on May 26, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Won't give the result you are seeking.

One h1 is all you get (page, section, or caption). G long ago reduced values for h1 due to the misuse for STYLE reason YEARS AGO.

tangor

4:38 am on May 27, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Meant to say, and forgot about it in the rush of this that and the other, that h tags are semantic in nature and should be reserved for that purpose. This makes more sense for the accessibility crowd and the rest of the universe in general. :)

csdude55

6:02 am on May 27, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Echoing tangor, I use styled <H1> and <H2> for my logo because Google used to like it. That stopped working years ago, but I haven't changed it yet. It doesn't seem to hurt, but it doesn't help either.

tangor

6:42 am on May 28, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It doesn't seem to hurt, but it doesn't help either.


It will, eventually! Clean up the code to embrace semantics. Create logical css styles for all other things and g will eventually let you back in the fold. Takes time, but it will make a difference in a few months.

Did that myself years back when switching from 1996-tables-templates to RWD, logical css, and making full use of html5.