首页 > 其他 > 详细

display的用法flex

时间:2015-08-04 15:09:42      阅读:171      评论:0      收藏:0      [点我收藏+]
 做移动端这种布局格式很好,上和下固定,中间自适应,但要设置body为100%
  这里还有个问题是安卓设备下会把他撑上去,所以要兼容安卓得要上间下都得固定

html,
body {
  height: 100%;
}
body {
  margin: 0;
}
article {
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
}
header {
  height: 50px;
  background: #ccc;
}
footer {
  height: 50px;
  background: #ccc;
}

section {
  flex: 1;
  background: #eee;
}

---html---
 <article class="indexPage">
     <header></header>
     <section></section>
     <footer></footer>
</article>

 

display的用法flex

原文:http://www.cnblogs.com/yanwen2015/p/4701924.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!