I want my div to be clickable and link to an external url. Why doesn’t this work or what should I do instead?
html:
<div id="logo_left">
<a href="..external url.."></a>
</div>
Stylesheet:
#logo_left {
//stylestuff
}
#logo_left a {
display: block;
height: 100%;
width: 100%;
}
You should take only the
<a>and make it into adisplay: block;Working Example
Alternatively, if you are using
<!doctype html>, you could wrap the div inside an<a>and have it clickable that way.Working Example