<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>By Joinli</title>
</head>

<body>
<h3>除了ie6浏览器之外,overflow:hidden属性具有清除浮动的效果</h3>


<div style="background:#ccc;overflow:hidden;">
  <div style="float:left;">已清除浮动:父级自适应浮动内容,可看见父级的灰色背景</div>
</div>


<br /><br />


<div style="background:#ccc;">
  <div style="float:left;">没清除浮动:父级收缩起来了,不可看见父级的灰色背景</div>
</div>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-03
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-10-05
  • 2021-06-03
相关资源
相似解决方案