style中的clear:both
来源:互联网 发布:面向对象的编程 编辑:程序博客网 时间:2024/04/24 08:28
style中的clear:both
在CSS中我们会经常要用到“清除浮动”Clear,比较典型的就是clear:both;
CSS手册上是这样说明的:该属性的值指出了不允许有浮动对象的边。这个属性是用来控制float属性在文档流的物理位置的。
当属性设置float(浮动)时,其所在的物理位置已经脱离文档流了,但是大多时候我们希望文档流能识别float(浮动),或者是希望float(浮动)后面的元素不被float(浮动)所影响,这个时候我们就需要用clear:both;来清除。
比如:
<p style="float:left;width:200px;">这个是第1列,</p>
<p style="float:right;width:400px;">这个是第2列,</p>
<p>这个是第3列。</p>
如果不用清除浮动,那么第3列文字就会和第1、2列文字在一起 ,所以我们在第3个这列加一个清除浮动 clear:both;
<p style="float:left;width:200px;">这个是第1列,</p>
<p style="float:left;width:400px;">这个是第2列,</p>
<p style="clear:left;">这个是第3列。</p>
通常,我们往往会将“清除浮动”单独定义一个CSS样式,如:
.clear {
clear: both;
}
然后使用<div class="clear"></div>来专门进行“清除浮动”。
原文:
http://blog.sina.com.cn/s/blog_7f854a010100re65.html
示例
<style>
.clear10{clear: both; height:10px; overflow:hidden;}
.yao{float:left;width:100px;}
</style>
<div class="yao">大家好</div>
<div class="yao">我也很好</div>
<div class="clear10"></div>
<div class="yao">大家好</div>
原文:
http://zhidao.baidu.com/question/157056984.html
转自:style中的clear:both - 浪里飞 - 博客园
http://www.cnblogs.com/mydomain/archive/2012/10/18/2730319.html
- style中的clear:both
- style中的clear:both
- <div style=\'clear:both\'></div>
- 正确理解css中的 clear:both
- CSS 定位时一定要用的 style clear=both
- clear:both
- clear:both
- clear both
- CSS代码中的“clear:both;”失效了
- firefox CSS溢出 加 一个空<div style="clear:both"></div>
- CSS 的 clear:both;
- Clear both 的妙用
- clear:both的认知
- css中clear:both
- clear:both的理解
- clear:both的理解
- clear:both 属性讲解
- clear:both的理解
- Mysql本地提权漏洞/写my.cnf文件命令执行漏洞
- Jsp与servlet的区别
- JS实现刷新iframe的方法
- struct spring hibernate辨析
- GRADIENT DESCENT(梯度下降法)(两例对应两牛文均用该法求解目标函数)
- style中的clear:both
- Spring和SpringMVC的区别
- IOS网络操作-使用Alamofire和ObjectMapper处理JSON转对象
- java程序与操作系统API的关系
- DIV总显示在页面底部css
- 梯度下降法解逻辑斯蒂回归
- 梯度下降法解神经网络
- 在ASP.NET中怎么获取动态文本框的值(在程序的后台获取)
- 应用机器学习建议