Make An Entire Div Clickable

Date: 10/13/2015, Author: Lostwake, Category: CSS Tricks

I have come across this problem more than once so here is a simple solution to making an entire div clickable.

HTML

div class="button"
a href="http://lostwake.com/button%20link" Link Text a
div

CSS

.button {
	position: relative;
}
.button a {
	position: absolute;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
}

This works for me every time.

Source

Comments: