DIV+CSS clear both清除产生浮动
来源:互联网 发布:打色子软件 编辑:程序博客网 时间:2024/04/30 13:52
1、clear语法:
clear : none | left|right| both
2、clear参数值说明:
none : 允许两边都可以有浮动对象
both : 不允许有浮动对象
left : 不允许左边有浮动对象
right : 不允许右边有浮动对象
3、clear解释:
该属性的值指出了不允许有浮动对象的边情况,又对象左边不允许有浮动、右边不允许有浮动、不允许有浮动对象。
4、css结构
div{clear:left}
div{clear:right}
div{clear:both}
我们常常用于使用了float css样式后产生浮动,最常用是使用clear:both清除浮动。比如一个大对象内有2个小对象使用了css float样式为了避免产生浮动,大对象背景或边框不能正确显示,这个时候我们就需要clear:both清除浮动。
<!DOCTYPE html><html><head><title>DIV+CSS clear both清除产生浮动</title><style type="text/css"> .divcss5{width:500px;background:#000;border:1px solid #F00;padding:10px} .divcss5_left,.divcss5_right{ border:1px solid #FFF;background:#999;width:200px;height:150px} .divcss5_left{ float:left}/* 设置浮动靠左 */ .divcss5_right{ float:right}/* 设置浮动靠右 */ .clear{ clear:both} </style></head><body><div class="divcss5"> <div class="divcss5_left">float left盒子</div> <div class="divcss5_right">float right盒子</div> <div class="clear"></div> </div></div></body></html>
0 0
- DIV+CSS clear both清除产生浮动
- DIV+CSS clear both清除产生浮动
- [HTML]DIV+CSS clear both清除产生浮动
- CSS clear both清除浮动
- CSS clear both清除浮动
- CSS clear both清除浮动
- css Clear:both 清除float浮动
- CSS 浮动(float:left),清除浮动(clear:both)
- div CSS 清除float常用方法(:after和clear:both)
- css clear 清除浮动
- 清除浮动clear:both的应用详解
- 清除浮动“clear:both;”的应用
- 巧妙运用清除浮动clear:both
- 清除浮动 clear:both的原理
- DIV布局之道四:clear:both清除DIV两侧浮动详解
- CSS清除浮动_清除float浮——详解overflow:hidden 与clear:both属性
- CSS清除浮动常用方法小结 CSS clear both {overflow:auto;zoom:1;}
- 如何清除浮动不用另外在div中写clear:both
- Property List Programming Guide(二)
- Textview显示Html 图文混排
- Linux 用户组权限+高级计划任务
- android 广告自动循环播放(CircleViewPager)
- 6月份业余时间安排
- DIV+CSS clear both清除产生浮动
- ListView(2)SimpleAdapter与SimpleCursorAdapter详解
- C++成员函数的存储方式
- 1105 S-Trees
- 第16周阅读程序1(1)
- 1106 Transmitters
- java异常总结
- Libgdx之Table 表格排版
- 做程序猿的wife应该注意的一些事情