我有以下HTML:行爲
<div id="test">
<p>
Floating behaves differently with paragraphs. Floating behaves differently with
paragraphs. Floating behaves differently with paragraphs.
</p>
</div>
這個CSS:
#test{
float:left;
background-color: #222;
margin-left: 4%;
width: 300px;
padding-top: 15px;
padding-right: 30px;
padding-left: 30px;
text-align: justify;
color: #FFF;
}
你可以在http://jsfiddle.net/fM4bE/看到有在測試股利由對創造的底部空間/ p。如果我們刪除浮動:左這個空間消失,就好像它不是任何/ P ...任何人都可以向我解釋爲什麼?
謝謝
閱讀關於[緣塌陷(https://developer.mozilla.org/en-US/docs/Web/CSS/margin_collapsing) – Adrift