It seems there are a few different techniques out there, so I was hoping to get a "definitive" answer on this...
On a website, it's common practice to create a logo that links to the home page. I want to do the same, while better optimizing for search engines, screen readers, IE 6+, and browsers that have disabled CSS and/or images.
Example one: doesn't use an h1 tag. Not so good for SEO, right?
<div id="logo">
<a href="">
<img src="logo.png" alt="CreandoLaRed" />
</a>
</div>
Example two: I found this somewhere.
<h1 id="logo">
<a href="">CreandoLaRed</a>
</h1>
/* css */
#logo {
padding: 70px 0 0 0;
overflow: hidden;
background-image: url("logo.png");
background-repeat: no-repeat;
height: 0px !important;
height //:70px;
}
Example three: Same HTML, different approach using text indent. This is the "Phark" approach to image replacement.
<h1 id="logo">
<a href="">CreandoLaRed</a>
</h1>
/* css */
#logo {
background: transparent url("logo.png") no-repeat scroll 0% 0%;
width: 250px;
height: 70px;
text-indent: -3333px;
border: 0;
margin: 0;
}
#logo a {
display: block;
width: 280px;
height: 120px;
text-decoration: none;
border: 0;
}
Example four: the Leahy-Langridge-Jefferies method. It shows up when images and/or css are disabled.
<h1 id="logo" class="logo">
<a href="">CreandoLaRed</a>
</h1>
/* css */
h1.logo {
margin-top: 15px;
position: relative;
overflow:hidden;
padding: 0;
}
h1.logo a {
position: absolute;
height: 0;
width: 100%;
background-position: left top;
background-repeat: no-repeat;
}
h1#logo {
height: 60px;
}
h1#logo a {
padding-top: 60px;
background-image: url("logo.png");
}
Which method is best for this kind of thing? Provide html and css in your answer.