<!doctype html><html> <head> <meta charset="UTF-8"> <title>margin傳遞</title> <style type="text/css"> body { margin: 0; } .d1 { background-color: #6183F3; height: 100px; } .da { background-color: #D60003; height: 200px; } .db { width: 200px; height: 200px; background-color: #FF8D8F; margin: 10px; } .dc { height: 100px; background-color: #6E0001; } </style> </head> <body> <div class="d1"></div> <div class="da"> <div class="db"></div> </div> <div class="dc"></div> </body></html>da的子元素dd設置外邊距之后左右邊距和上邊距都出現了外邊距,但是為何margin-bottom不把dc(深紅色)往下移10px,知道解決辦法,但是就是想請問大神們為何會造成這個現象?非常感謝
- 3 回答
- 0 關注
- 6397 瀏覽
相關問題推薦
添加回答
舉報
0/150
提交
取消