css - How can I make a link inside a div fill the entire space inside the div? -
i have div
has set width , wrapped around link. want link inside fill entire space of div
when click anywhere inside div
(which have styled button) goes link. have tried, .link_class
doesn't want. suggestions?
html:
<div class="button_class"> <a class="link_class" href="http://www.my_link.com>my link</a> </div>
css:
.button_class { width:150px; padding:5px 7px; color:#fff; text-align:center; -webkit-border-radius:3px; -moz-border-radius:3px; border-radius:3px; } .link_class { width:100%; height:100%; }
this should trick:-
by default a
inline element , width not affect them. change inline-block have take width specify.
.link_class { display:inline-block; width:100%; height:100%; }
Comments
Post a Comment