Home > Web Front-end > HTML Tutorial > float学习笔记_html/css_WEB-ITnose

float学习笔记_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 11:28:49
Original
1140 people have browsed it

float 系统学习

  • float的原本作用是产生文字环绕效果
  • float可以产生包裹、隔绝的效果( BFC)、破坏性

其他具有包裹性质的属性

display : inline-block table-cellposition: absolute/fixed/sticky???overflow: hidden/scroll
Copy after login

什么是破坏性

父元素的高度塌陷
Copy after login

其他具有破坏性的属性

display: noneposition: absolute/fixed/sticky
Copy after login

清除浮动(放在浮动元素的父元素上)

  • clear
  • bfc

clearfix的代码

.clearfix:after {    content: '';    display: block;    height: 0,    overflow: hidden;    clea    r: both;}.clearfix {     *zoom:1}/*兼容IE6、7*//****************方式二*******************/.clearfix:after {    content: '';    display: table;    clear: both;}.clearfix {    zoom:1;}
Copy after login

BFC

float: left/rightposition: absolute/fixedoverflow: hidden/scrolldisplay: inline-block/tabel-cellwidth/height/zoom:1(*IE6/IE7*)
Copy after login

浮动可以用来去除元素之间的空格

‘ ’;的空格可能会对布局造成影响因为‘‘‘ ’;当做普通文本来显示了

浮动与流体布局

???高端的

float

display: inline-block

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template