html - css extend border to include image -
this question has answer here:
- why content showing outside div? 4 answers
i have html div id information
. ideally, border extend bottom of image in div.
<div id="information"> <img src="newtroot-256.png" id="newtroot256" style="float:left;"/> <span style="position:relative;left:10px;"> hi! name nicki. </span> </div>
for html and
div#information { color:burlywood; margin-left:2em; margin-right:2em; border:2px solid lime; border-radius:25px; background-color:rgba(85,107,47,0.75); padding:10px; background-opacity:0.5; }
for css relevant parts. output is
but want border include image. how css/html. not wish incude javascript, if it's soulution, i'll take it.
because image floated, removed normal flow. make parent expand, float must cleared.
#information:after { content: ''; display: table; clear: both; }
Comments
Post a Comment