页面布局之flex布局
flex布局 flex布局 也叫作 弹性盒子布局 ,可以简便、完整、响应式的实现各种页面布局,同时也支持所有的浏览器。父级元素设置css样式为:display:flex。内容的位置用justify-content来控制,常用的属性有: space-between 、 space-around 、 center 、 left 、 right 。(注释:类名为father的盒子中写了4个类名为son的盒子) 一共有6个属性是添加给父级的,分别有: flex-direction 、 flex-wrap 、 flex-flow 、 justify-content 、 align-items 、 align-content 。 flex-direction 用来决定主轴的方向,默认值为row,所以默认横向排列。row|row-reserve|column|column-reserve。 flex-wrap 来决定换行,nowrap不能换行;wrap换行,多余的自动在左下方;wrap-reserve换行,多余的自动在左上方,默认值为nowrap。 flex-flow 是flex-direction和flex-wrap的简写,默认值为row nowrap。 .father { width: 500px; height: 150px; display: flex; justify-content