css - Parent div to follow height of child - for child without float -
the answer can find problem clear float - have non. hope can answer :-)
here code, , trying make parent div of button follow expansion done padding.
<div class="button"> <a href="#">add</a> </div>
and css
.button { background-color: #ccc; } .button { background-color: #96bd1e; color: black; font-size: large; padding: 6px 12px; width: 120px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -opera-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; height: 59px; margin: 10px; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; clear: both; }
and here example of play http://jsfiddle.net/znlvz/1/
change css this:
.button { background-color: #ccc; } .button { display:inline-block; background-color: #96bd1e; color: black; font-size: large; padding: 6px 12px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -opera-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; margin: 10px; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; clear: both; }
Comments
Post a Comment