正如您在這張圖片中看到的,我在div綠色內(nèi)部有一個(gè)橙色div,沒有頂部邊框。橙色div具有30px最高邊距,但同時(shí)也將綠色div壓低。當(dāng)然,添加頂部邊框可以解決此問題,但是我需要綠色div無邊框。我能做什么?.body { border: 1px solid black; border-top: none; border-bottom: none; width: 120px; height: 112px; background-color: lightgreen;}.body .container { background-color: orange; height: 50px; width: 50%; margin-top: 30px;}<div class="header">Top</div><div class="body"> <div class="container">Box</div></div><div class="foot">Bottom</div>
CSS:當(dāng)父母無國界時(shí)的邊際收益
繁華開滿天機(jī)
2019-10-18 14:33:13