flex布局

2017-07-06  本文已影响0人  yytyff

在flex之前用

float + clear

position relative + absolute

display inline-block

负margin

flex (flexible:弹性,灵活)

1.与方向无关
2.空间自动分配,自动对齐
3.简单的线性布局

flex container 的属性

flex-direction 方向

flex-direction: column-reverse;| column|row|row-reverse;

flex-wrap 换行

 wrap|nowrap

flex-flow 上面两个的简写

justify-content 主轴方向对齐方式

space-between|space-around|flex-start|flex-end|center

align-items 侧轴对齐方式

align-content 多行/列内容对齐方式(用得较少)

http://js.jirengu.com/jiluk/4/edit

flex item 的属性

flex-grow 增长比例(空间过多时)

flex-shrink 收缩比例(空间不够是)

flex-basis 默认大小(一般不用)

flex 上面三个的缩写

order 顺序(代表双飞翼)

align-self 自身的对齐方式

http://js.jirengu.com/fogol/2/edit

http://js.jirengu.com/fogol/3/edit


1.手机页面布局

http://js.jirengu.com/kezan/2/edit

2.产品列表

http://js.jirengu.com/kosos/2/edit

3.PC布局

http://js.jirengu.com/hahed

4.完美居中

http://js.jirengu.com/yapur

上一篇下一篇

猜你喜欢

热点阅读