小程序wxss知识点

2019-05-14  本文已影响0人  kayling

padding

padding 就是内边距,就是说控制上下左右的边距,让界面感觉没有那么拥挤,但实战是却遇到padding有时候带1个参数、有时候带2个参数、有时间带4个参数

padding: 5px;    带一个参数,表示上下左右都是5px距离
padding: 5px 0;  带两个参数,表示什么呢?表示上下都是5px,左右都是0px,就是这里容易出错,切记切记!
padding: 5px 4px 3px 2px; 带四个参数,表示上5px,右 4px,下3px,左2px

display

display flex容器的属性

flex-direction属性

flex-direction属性决定主轴的方向(即项目的排列方向)

.box {  
   flex-direction: row | row-reverse | column | column-reverse;  
}  

flex-wrap属性

默认情况下,项目都排在一条线(又称"轴线")上。flex-wrap属性定义,如果一条轴线排不下,如何换行

.box{  
  flex-wrap: nowrap | wrap | wrap-reverse;  
}  

flex-flow

flex-flow属性是flex-direction属性和flex-wrap属性的简写形式,默认值为row nowrap。

.box {  
  flex-flow: <flex-direction> || <flex-wrap>;  
}  

justify-content属性

justify-content属性定义了项目在主轴上的对齐方式

.box {  
  justify-content: flex-start | flex-end | center | space-between | space-around;  
}  

align-items属性

align-items属性定义项目在交叉轴上如何对齐

.box {  
  align-items: flex-start | flex-end | center | baseline | stretch;  
}  

align-content属性

align-content属性定义了多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用

box {  
  align-content: flex-start | flex-end | center | space-between | space-around | stretch;  
}  
上一篇 下一篇

猜你喜欢

热点阅读