I have a block of HTML that looks like this:
<div id="header">
<h1>title</h1>
<h2>subtitle</h2>
</div>
I'm using a CSS technique to hide all that text and replace it with an image. But I want to link the whole block to the homepage. I can't wrap it in <a>
because that wouldn't be standards-compliant. So how do I do it?
My solution; inspired by New in town
<div id="header">
<h1>title</h1>
<h2>subtitle</h2>
<a href="index.html">Home</a>
</div>
#header {
text-indent: -9999px;
width: 384px;
height: 76px;
background: transparent url(../images/header.png) no-repeat;
margin: 10px;
position: relative;
}
#header a {
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}