kwi*_*chz 4 html css
这是我的 div 的完整示例。
为什么不footer从父 ( container)获取背景颜色?
footer
container
Eri*_*lli 5
当你float是一个元素时,这就像它与父元素断开连接。因此,inherit值不能被继承。此外,父母停止扩展到孩子的高度。删除它float,您可以看到它正在工作。
float
inherit
但是,如果你真的需要float,你需要把background-color上footer。
background-color
请记住,您可以在另一个答案上显示喜欢<div style="clear: both"></div>之后再放一个footer,但这只是一个技巧,让父母可以跟随孩子的身高。
<div style="clear: both"></div>
归档时间:
14 年,7 月 前
查看次数:
2051 次
最近记录: