css - Why the text or images are not placed behind a floating element? -


why text or images not placed behind floating element?

on link:http://codepen.io/anon/pen/lvwmvp, can see example. "blue" div placed behind "transp" div. thing text (or image) not placed behind "transp" div also. , please notice p tag in "blue" div.

so question is: why happen? why text not placed behind "transp" div parent?

i have been looking answer. couldnt find explaining situation.

could please me? :)

this code find on codepen.io: html

<div id="transp"> </div>  <div id="blue">     <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. aliquam id dolor scelerisque, pellentesque arcu sed, vehicula enim. class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. duis felis eros, accumsan eget erat non, vulputate blandit urna. sed consequat nibh vitae lectus tempor viverra. quisque condimentum, elit id pretium accumsan, quam nunc faucibus risus, id tincidunt massa est in turpis. </p> </div> 

css:

#transp{     border: 1px solid #000;     height:200px;     width:200px;     float:left; }  #blue{     background-color:#00ffff;     height:200px;     width:600px; } 

this see: floating issue

the point of floating place object beside paragraph of text or other inline content, such content flow around it. spec:

a float box shifted left or right on current line. interesting characteristic of float (or "floated" or "floating" box) content may flow along side (or prohibited doing 'clear' property). content flows down right side of left-floated box , down left side of right-floated box.

having text ignore float defeat purpose of floating altogether.

the float removed normal flow, why "blue" div positioned though floating element not there. result text flows vertically past floating element start directly underneath, rather leaving gap there. can see if make div narrower , taller (or remove height declaration).


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -