Forum Moderators: open

Message Too Old, No Replies

Proper Use of Heading Tags

debate

         

moltar

7:19 pm on Mar 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am a big fan of standard compliant sites. I try my best to write semantic code. I make sure my sites validate. But for the longest time I have this one unanswered question. Maybe it's more of a debate, not really a question...

Every site has it's own title. Most sites have a slogan. For now, let's assume that an imaginary website we are talking about has both.

How would you markup the page:


<body>
<h1>Site Title</h1>
<h2>The best slogan</h2>

<h1>Page Title</h1>
<h2>subtitle</h1>
</body>

OR

<body>
<p>Site Title</p>
<p>The best slogan</p>

<h1>Page Title</h1>
<h2>subtitle</h1>
</body>

or maybe there are other solutions?

tedster

8:16 pm on Mar 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I prefer #2 by a wide margin. A SERP lists pages, not domains - so each page need its own strong focus and #2 offers that potential.

In fact, I often place a slogan, tagline, or even the site title, in a graphic. I usually don't really want that text hammered home, over and over, at the top of each page. Well, maybe sometimes I do, depending on keywords involved, or the depth of the site, intensity of the competition.

My point is that I consciously decide when I want that kind of text on a page and when graphic text offers a chance to conentrate the page on other keywords (or even to back off from too high a kw density.)

encyclo

8:29 pm on Mar 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OR (because there are more than two choices!)

<head> 
<style type="text/css">
body {background:#fff url(site-logo-with-tagline.jpg) no-repeat top left;}
</style>
</head>
<body>
<h1>Page Title</h1>
<h2>subtitle</h1>
</body>

Repeating the same site name/tagline in hx elements on every page is a complete waste. The searcher is not looking for your site name or your tagline. In fact he doesn't even care about your site: he's looking for the information on that particular page.

moltar

8:33 pm on Mar 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can think of one good use of the 1st solution - print style sheets. That way use will have a heading of your site on the print outs. Of course, that rarely happens :)

What about in the case of a blog. Usually on the main page there are listings of headers and articles (or their snippets). Header is clickable for a separate page with a full entry and sometimes comments.

So each title on the main page would be an h1?

tedster

4:08 am on Mar 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been giving this some thought from a purely semantic point of view, rather than SEO.

An H1 tag indicates a page's main topic - therefore usually you would have one H1 element per page, and only rarely one or two more. If it seems like there should be multiple H1 tags most of the time, then I would take a hard look at the site's information architecture - it's probably too chaotic for best results. And from a purist stand point, anyway, the site's title does not seem like it should be the main topic of any inner page.

The blog situation is interesting to consider. In most cases, each separate topic is NOT the main topic for the page. So that feels like an H2 element to me, especially if there is some related content below the clickable header. And if each comment has a title, that would be an H3. The H1 would then be...what, recent postings or something like that?

bill

4:21 am on Mar 25, 2005 (gmt 0)

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



A lot of Blog software offer templates which by default put your site name at the top of every single page in an H1. Are you suggesting that might be a poor choice? It would be trivial to change these templates, but not many would know to do so. Are you suggesting that something like this would be more appropriate:

<p class="bannertext">Top Banner Text</p>
<h1>Topic for this page</h1>

ronin

12:44 pm on Mar 25, 2005 (gmt 0)

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



Yes, bill, the <h1> should be the main heading for the page, rather than the name of the site. In most cases the <h1> for each page should also be different from the <h1> on all other pages on the same site (... unless you have a single article spread across several pages or something).

If the name of the site is included on the page - somewhere near the top, say - it probably shouldn't be enclosed in <h1> tags.

If you imagine a standard academic paper it may be outlined like this:

Main Heading <h1>

1.0 <h2>

2.0 <h2>

3.0 <h2>

3.1 <h3>

3.2 <h3>

3.2.1 <h4>

3.2.2 <h4>

3.3 <h3>

4.0 <h2>

MatthewHSE

5:49 pm on Mar 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Headings and paragraphs are meant to provide a sort of "outline" of the page. So that's how I use them. A site title or a tagline, to me, doesn't belong as a heading on an individual page. Since each page has (or should have) its own topic, that topic should be the <h1> for the page. Paragraphs and other heading tags should follow in natural outline style.

In a few cases, I have some areas of text that don't really fit into an outline of the page. At these times, I normally wrap the text in a <div> and it doesn't really take a place in the semantics of the page at all.

Slightly off topic, but related...

The searcher is not looking for your site name or your tagline. In fact he doesn't even care about your site: he's looking for the information on that particular page.

Putting it quite brutally, it sometimes doesn't matter what the searcher is looking for. That is, it matters a lot, but there may still be good reason to include a tagline or site name even if the searcher doesn't care about that particular bit of information. Sometimes you need that tagline, or title, or whatever, in order to integrate your branding with your product. In some cases, it may even attract the attention of the searcher and get him interested in your site, even though he might not have cared when he visited.

My site header has an extremely short (15px high) tagline. It appears on every page, at the very top, unobtrusive but highly visible and obvious. It defines what the site is all about. It's the essence of the site, if you will, summed up in a single, catchy phrase. We've gotten a lot of comments from people who have appreciated it being there.