How do you use H1 and Title Elements?

posted by Kravvitz at 10:34 PM on Nov. 4th, 2008

Categories: HTML, Semantics 1 comments
So while considering what to cover first, I read what other people have been writing about recently. One of the things that caught my attention was the old argument about how you should use <h1> elements.

What are <h1>s for? They are level one headers. So what is the most important idea in each document? Is it the Site Title? No, it's often not, but that's what many people seem to think. I've come to believe that <h1>, <h2>, etc. should be used to mark up the document structure of the page, not the site. Why else would there be several tools around that pull the contents of the header elements to make an outline of the page?

Some people also are ok with using multiple <h1>s on a page. To me, if you've got two equally important ideas on a page, it seems that you should split the page in two making one page for each idea.

Now for title elements, some people just put the site title in them. Now how is that useful for when people bookmark the page or find it via a search engine? How about switching between windows or tabs when you have multiple pages from such a site open? Other people even seem to use them for a little keyword stuffing. worried To me the title should at least start with the contents of the H1 on the page (assuming the H1 was used as I just suggested it should be used). I then like to use some kind of separator and then put the site title. Putting the site title before the page title makes less sense, because it ends up with the same problems of only putting the site title in the title element.
#1 Arem 4:54 PM on Nov. 5th, 2008
Good points Kravvitz. I was first made aware of the 'one h1 per page' issue through your comments elsewhere on this site. It is a good principle for structuring a page. This is particularly clear if you turn off CSS and view the page as HTML. It just looks 'right' for the main theme to come first, in the largest type, and the content to be broken up into sub headers.

It also makes perfect sense for the page title to reflect this main theme. One point I would make about titles, though, is that they tend to be way too long. I prefer a page title that encapsulates the page content neatly and tightly. Further details can go into the page description.

Login or Register to post a comment