clear在css中有清除、清理的意思,是CSS中的一个属性,用于清除浮动;clear属性规定元素的哪一侧不允许其他浮动元素,其使用语法如“img{float:left;clear:both;}”,该语句表示图像的左侧和右侧均不允许出现浮动元素。

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
在CSS中,clear有清除、清理的意思。clear是CSS中的一个属性,用于清除浮动。下面本篇文章就来给大家介绍一下CSS clear属性,希望对大家有所帮助。
CSS clear属性
clear 属性规定元素的哪一侧不允许其他浮动元素。
立即学习“前端免费学习笔记(深入)”;
说明
clear 属性定义了元素的哪边上不允许出现浮动元素。在 CSS1 和 CSS2 中,这是通过自动为清除元素(即设置了 clear 属性的元素)增加上外边距实现的。在 CSS2.1 中,会在元素上外边距之上增加清除空间,而外边距本身并不改变。不论哪一种改变,最终结果都一样,如果声明为左边或右边清除,会使元素的上外边框边界刚好在该边上浮动元素的下外边距边界之下。
思乐微信商城微分销系统是以.net+access/mssql进行开发的微信分销系统。基于微信朋友圈的传播,是打造以分销商为中心的全新微信分销体验。让粉丝实时有效的获取朋友圈流量并快速分享购买分佣。因为是基于微信,所以要在微信上体验才更好。关注我们的微信核心功能:1、自动提示用户关注微信,解决一般程序无关注微信公众号的过程2、只要通过链接进一次,不过好久注册,什么方面注册,只要是用微信注册的,都会算
属性值:

示例:
![]()
没有清除浮动!This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
没有清除浮动!This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.
![]()
没有清除浮动!This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
清除浮动!This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.
效果图:

【推荐:css视频教程】









