In following, .p1
is cleared from earlier floating box and applied a top margin to it expecting it would shift further below from the top edge of viewport, then what is achieved with clear
, however the margin-top
does not seem to work if clear
is used, if clear
is removed, it works. Why?
HTML
<span style="float:right;width:30%;">
content content content content content content content content...
</span>
<p class="p1">content content content content...</p>
<p>content content content content...</p>
CSS
span, p {
border: 3px solid black;
background-color: #ede;
padding: 10px; }
.p1{
clear: both;
margin-top: 200px;
}
Can anybody explain why this margin-top
does not work on .p1
?