在下面簡單的CSS代碼的直筒,我想的h1
與p
底部平直的底部(h1
不應該p
下,像在我的代碼)。邊距兩個元素
<div id="sqrs" style="width:200px; height:200px; border:1px solid BLACK;">
<p style="width:100px; height:100px; background-color:BLUE; float:right;">blue</p>
<h1 style="background-color:YELLOW; margin-top:100px;">yellow</h1>
</div>
P
風格不能改變,我不知道h1
的height
(因爲它可以h2
,h3
...)
我試過margin-top:100%
(而不是margin-top:100px
),但是這不是解決方案。
感謝,
的jsfiddle或網址,請.. – supersaiyan
感謝您的回覆,但我無法找到答案。 – blsn
我還沒有回答!你有任何網頁的實時網址,以便我可以檢查 – supersaiyan