css考核点整理(一)-浮动的理解和清除浮动的几种方式

浮动的理解和清除浮动的几种方式

clear语法:
clear : none | left | right | both

取值:
none : 默认值。允许两边都可以有浮动对象
left : 不允许左边有浮动对象
right : 不允许右边有浮动对象
both : 不允许有浮动对象

float 会影响其他相邻元素,但clear只会影响自身

参考文档

http://www.zhangxinxu.com/wordpress/2014/06/understand-css-clear-left-right-and-use/

厚积薄发
原文地址:https://www.cnblogs.com/yingwo/p/4115099.html