Last active
August 29, 2015 14:15
-
-
Save JoanClaret/0f701470b0a880eb19e0 to your computer and use it in GitHub Desktop.
Make all div clickable with CSS using absolute positioning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Make all div clickable with CSS <span>using absolute positioning</span></h2> | |
<div> | |
<a href="https://github.com/JoanClaret/" title="Github link">Github link</a> | |
<h2>Joan's Github</h2> | |
<p>Mixtape blog readymade, pork belly DIY sriracha hoodie. Cred gentrify freegan, swag DIY 90's tilde tousled listicle Thundercats. Seitan taxidermy Helvetica Blue Bottle, slow-carb Tumblr letterpress ugh plaid Thundercats mlkshk. | |
</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*{ | |
margin:0; | |
padding:0; | |
} | |
body{ | |
font-family:"Helvetica", "Helvetica neue", Arial; | |
padding:20px; | |
} | |
h1{ | |
color:#3498db; | |
} | |
h1 span{ | |
display: block; | |
font-size: 20px; | |
} | |
h2{ | |
margin-bottom:10px; | |
} | |
div{ | |
position:relative; | |
width:300px; | |
margin:30px 0; | |
background-color:#ccc; | |
padding:10px; | |
} | |
a{ | |
position:absolute; | |
left:0; | |
right:0; | |
top:0; | |
bottom:0; | |
text-indent:-100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DEMO: http://codepen.io/joanclaret/pen/yypPZb/