If I have division with height: 100px;
and it contains a link inside - can I make link fill the height of the division without hard-coding the value?
<div><a href="#">hello</a></div>
div {
height: 100px;
width: 100px;
background: red;
}
a {
background: green;
height: 100%; /* This does not work. Is it possible to set this height to 100% of container? */
}
Fiddle: http://jsfiddle.net/nPL65/
Add:
display: block;
height: 100%;
Though I don't know if you mind the link spanning the width of the <div>
If you do just set the <a>
to display: inline-block;
jsFiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With