Which <hn> elements?

L

Leif K-Brooks

On many sites, the site name is displayed with the title of the current
page displayed under that. But which <hn> elements should be used for
those two headings? Should they both he <h1>s? Should the site title be
<h1> and the page name <h2>? Should the site name be <div> and the page
title <h1>? Something else?
 
B

Brett

You can choose to do this any way you wish. Although if your trying to
optimize for search engines you should use <h1> for the title that best
describes the page. In this case it will probably be the title that's under
the site name. I normally don't focus to much on the <h2,3,4,ect> but you
could probably use the <h2> for the site name. I think most search engines
would see the <h2> as a title but not give the words as high a value as the
<h1>. Of course, if you want the <h2> (site name) to be larger you can use
css to create the affect you want.

If it was my call and there weren't a lot of keywords in the site name I
would probably use <div> for the site name and <h1> for the page title.
 
T

Toby A Inkster

Leif said:
On many sites, the site name is displayed with the title of the current
page displayed under that. But which <hn> elements should be used for
those two headings?

<h1><span class="site">Site Title</span>:
<span class="page">Page Title</span></h1>
 
J

Jukka K. Korpela

Leif K-Brooks said:
On many sites, the site name is displayed with the title of the current
page displayed under that. But which <hn> elements should be used for
those two headings?

Are they headings?
Should they both he <h1>s?

Two first-level headings? Hardly.
Should the site title be <h1> and the page name <h2>?

Is the site name a first-level heading for the page? And the page name a
second-level heading for the page? Hardly.
Should the site name be <div> and the page title <h1>?

Yes. The page title is the first-level heading. The site name is logo-like
information, for which no specific markup is available in HTML, so it boils
Something else?

Toby's suggestion to put _both_ into a single <h1> element is feasible in
some cases. It would mean that the site name is part of the first-level
heading. It's surely the best approach if the page name is not very
informative as such, e.g. if you are converting a book to HTML form and you
make (rather reasonably) each chapter a separate page and the chapters are
named just as "Chapter 5".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top