首页 > Web开发 > 详细

CSS clear清除浮动

时间:2016-06-06 00:44:11      阅读:233      评论:0      收藏:0      [点我收藏+]

1、CSS中的clear有四个参数:

  none:允许两边都可以浮动。

      left:不允许左边有浮动。

      right:不允许右边有浮动。

      both(默认);不允许有浮动。

2、一开始在CSS中clear浮动是默认both,也就是说一开始不能有浮动的。

3、使用的案例:假设我清除第三个DIV的浮动

<style type="text/css">
div{
border:1px solid red;
float:left;
clear:none;
}
#msg_Div{
width:600px;
height:600px;
}
.one{
width:100px;
height:90px;
}
.two{
width:100px;
height:90px;
}
.three{
width:100px;
height:90px;
clear:left;
}
.four{
width:100px;
height:90px;
}
.five{
width:100px;
height:90px;
}
</style>

 

<body>
<div id="msg_Div">
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="four"></div>
<div class="five"></div>
</div>
</body>

效果:

   技术分享

CSS clear清除浮动

原文:http://www.cnblogs.com/yichjin/p/5562414.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!