热门标签 | HotTags
当前位置:  开发笔记 > 前端 > 正文

css3的flex应用总结

常用:1,移动端盒子display:-webkit-flex;*Safari*display:flex;pc端display:flex;-webkit-jus

常用:

1,移动端盒子

display: -webkit-flex; /* Safari */
display: flex;

pc端

display: flex;
-webkit-justify-content: center;
-o-justify-content: center;
justify-content: center;
-webkit-align-items: center;
-o-align-items: center;
align-items: center;

2,水平居中

  -webkit-justify-content: center;
  -moz-justify-content: center;
  -ms-justify-content: center;
  -o-justify-content: center;
  justify-content: center;

3,竖直居中

 
 
-webkit-box-align: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;

4,水平两端对齐

-webkit-box-pack:justify;
-webkit-justify-content:space-between;
-ms-flex-pack:justify;
justify-content:space-between;


5,子元素-平均分栏 

-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;

6,横向换行

-webkit-box-lines: multiple;*/
  /* 12版 */
  -webkit-flex-wrap: wrap;
  -moz-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  -o-flex-wrap: wrap;
  flex-wrap: wrap;

7,纵向排列

/* 09版 */
  -webkit-box-orient: vertical;
  /* 12版 */
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  -ms-flex-direction: column;
  -o-flex-direction: column;
  flex-direction: column;



推荐阅读
author-avatar
9baibai_555
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有