`
kujo
  • 浏览: 22662 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
收藏列表
标题 标签 来源
CSS clear 用法 css, clear, float CSS clear 用法
你不加clear:both在火狐,IE8中打开!!肯定是不行的foot会浮上去!!!但在IE6,7是显示正常页面!!
而加了clear:both浏览器所显示的效果都一致了(IE5没试)!!
代码没改就是放到一个页面里你试试
<html>
 <head>
  <title> New Document </title>
<style type ="text/css">
#head{width:100%; height:20px; background:#789;}
#left{float:left; width:200px; height:300px; background:#823;}
#right{float:right; width:200px; height:300px; background:#399;}
#foot{clear:both; width:100%; height:20px; background:#789;}
</style>
 </head>
<body>
   <div id="head">head</div>
<div id="left">left</div>
  <div id="right">right</div>
  <div id="foot">footer</div>
 </body>
</html>
Global site tag (gtag.js) - Google Analytics