我在玩CSS:
<body>
<div style="background-color:lightblue; border : 1px solid black">
<div style= "margin-bottom : 20px;">This is some text in a div element</div>
</div>
</body>
此代码使div标签与子div底部相距20像素。
<body>
<div style="background-color:lightblue">
<div style= "margin-bottom : 20px;">This is some text in a div element</div>
</div>
</body>
但是如果删除了border属性,则子div不会从父div处获取底边距,而是从html标签开始。为什么会这样?