Why the text or images are not placed behind a floating element?
On this link:http://codepen.io/anon/pen/LVWmvp, you can see the example. The "blue" div is placed behind the "transp" div. But the thing is that the text (or an image) is not placed behind the "transp" div also. And please notice that the p tag is in the "blue" div.
So my question is: Why does this happen? Why the text is not placed behind the "transp" div like his parent?
I have been looking for an answer. But I couldnt find something to explaining this situation.
Could you please help me? :)
This is the code you will 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 is what you will see: