Saturday, 17 August 2013

Why is only the text clickable in this div?

Why is only the text clickable in this div?

I am trying to create a div that is a button by putting an anchor inside a
div.
HTML
<div class="div1" style="width:300px;">
<a href="#">hello</a>
</div>
CSS
.div1 {
background-color:red;
color:white;
margin:5px;
border-width:5px;
border-style:solid;
padding:10px;
border-radius:5px;
text-align:center;
background: #494949 !important;
}
JSFiddle: http://jsfiddle.net/BzFyS/
I think it is not working because osomething simple I am missing with
positioning. Any tips?
Thanks

No comments:

Post a Comment