大型网站清除css浮动的最佳方法,例如:
<html >
<head>
<title>清楚css浮动的最佳方法</title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<style type="text/css">
.clearfix:after{content:" ";display:block;height:0;clear:both;visibility:hidden}
.clearfix{*+height:1%;}
.box{background:red;width:500px;position:relative;}
.left{float:left; background:blue;width:200px; height:100px;}
.right{float:right;background:#666;width:200px; height:200px;}
.ab{width:100px; height:100px;background:#999;position:absolute;right:-50px;;}
</style>
<div class="box clearfix">
<div class="l">left</div>
<div class="r">right</div>
<div class="ab">absolute</div>
</div>
</body>
</html>清除css浮动的最佳方法:
.clearfix:after{content:" ";display:block;height:0;clear:both;visibility:hidden;}
.clearfix{*+height:1%;}点击查看关于深圳富士康小时工招聘最新信息!
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
还木有评论哦,快来抢沙发吧~