html - css extend border to include image -


this question has answer here:

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

enter image description here

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

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -