css - div height overstretching when image is appended -
i'm having problem nested divs , height.
what want accomplish image's parent's height stretch fit image. happening parent overstretching , height bigger image.
you can check code working here: http://jsfiddle.net/83ke6/
html
<div class="select_box"> <div class="selected"> <img src="http://awardwallet.com/images/fbsmalllogo.png" /> </div> </div>
css
.select_box { display:inline-block; height:50px; border:1px solid blue; } .selected { border:1px solid gray; } img { border:1px solid red; }
so on case, .selected should equal img height, 5px heigher; help
by default img inline element , therefore reserves space under lines in paragraph. add display: block;
image remove spacing.
fiddle: http://jsfiddle.net/83ke6/3/
Comments
Post a Comment