flex 兼容写法

CSS样式

  • flex:定义布局为盒模型
  • flex-v:盒模型垂直布局
  • flex-1:子元素占据剩余的空间
  • flex-align-center:子元素垂直居中
  • flex-pack-center:子元素水平居中
  • flex-pack-justify:子元素两端对齐
  • flex-justify-space-around:平均分布
.flex {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

.flex-v {
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.flex-1 {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

.flex-align-center {
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.flex-pack-center {
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.flex-pack-justify {
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
}
.flex-justify-space-around {
	-webkit-justify-content:space-around;
	justify-content: space-around;
	-moz-box-pack:space-around;
	-webkit--moz-box-pack:space-around;
	box-pack:space-around;
}

猜你喜欢

转载自blog.csdn.net/fanlixing6/article/details/81900958