码迷,mamicode.com
首页 > 其他好文 > 详细

display的用法flex

时间:2015-08-04 15:12:49      阅读:89      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!