Posted: Wed May 23, 2007 1:46 am
I emailed Roger Johansson who writes this blog on this exact issue.
I wrote:Hi Roger,
I want to get your opinion on the correct mark-up for overall site
identity. Very often I want the site identity to be a logo, this of
course means I either need to make use of the img tag or background
CSS rule. So far I've always just gone with img because I consider the
logo to be an image in its own right rather than a background styling.
So I use this:
<h1><img src="siteLogo.gif" alt="Site Name" /></h1>
The alt attribute text is critical here as in the absence of image
support I want this mark-up to be treated as:
<h1>Site Name</h1>
Is this a reliable strategy? I've read other designers recommend
something more akin to:
<h1>Site Name</h1>
h1 {
height:100px; /* height of logo */
width:100px; /* width of logo */
background:url(logo.gif) no-repeat;
text-indent:-9000px;
}
But I'm not convinced.
Many thanks,
ole
Roger wrote: In my opinion the logo should definitely be an image in the markup.
Whether it should be in an h1 element is a bit more tricky. If the
logo is the most important, or top level, heading on a particular
page it probably should. Most site only have one such page - the home
page. What I do is put the logo in an h1 element on the home page,
but not on any other pages since they have more relevant headings.
I hope that answers your question.