Skip to content

Instantly share code, notes, and snippets.

@meub
Created June 26, 2013 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meub/5864429 to your computer and use it in GitHub Desktop.
Save meub/5864429 to your computer and use it in GitHub Desktop.
Semantic Div with Anchor
.container{
width:200px;
height:200px;
background-color:black;
color:white;
/*Important:*/
position:relative;
}
/*Important:*/
.link-spanner{
position:absolute;
width:100%;
height:100%;
top:0;
left: 0;
z-index: 1;
/* edit: fixes overlap error in IE7/8,
make sure you have an empty gif
background-image: url('empty.gif');*/
}
<div class="container">
text
<a href="https://www.google.com">
<span class="link-spanner"></span>
</a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment