flex实现经典的sticky footer布局
来源:互联网 发布:无间道陈永仁知乎 编辑:程序博客网 时间:2024/06/15 08:11
- 需求分析:当页面内容小于设备屏幕的高度时,底部footer部分固定在屏幕底部,当页面内容超出屏幕高度时,底部footer部分随页面变动,始终在页面的底部。
flex布局实现
html部分
<body> <header class="header-wrapper">标题部分</header> <section class="cont-wrapper">内容部分</section> <footer class="foot-wrapper">版权信息</footer></body>
css部分
html,body,header,footer,section,div,p{ padding:0; margin:0;}html{ height:100%;}body{ display:flex; display:-webkit-box; height:100%; flex-direction:column;}.header-wrapper{ width:100%; height:45px; line-height:45px; background:#abcdef; text-align:center; font-size:0.3rem; color:#333;}.cont-wrapper{ font-size:0.3rem; flex: 1 0 auto;}.foot-wrapper{ width:100%; height:48px; line-height:48px; text-align:center; background:#ccc; font-size:0.3rem; flex: 0 0 auto;}
兼容布局实现
html 部分
<div class="detail"> <div class="detail-wrapper clearfix"> <div class="detail-main"></div> </div> <div class="detail-close"> <i class="icon-close"></i> </div></div>
css部分
.detail{ position:fixed; left:0;top:0; width:100%; height:100%; z-index:100; overflow:auto; transtion:all 0.5s; background:rgba(7,17,28,0.8); .detail-wrapper{ width:100%; min-height:100%; .detail-main{ matgin-top:64px; padding-bottom:64px; } } .detail-close{ position:relative; width:32px; height:32px; margin:-64px auto 0; font-size:32px; clear:both; } }
阅读全文
0 0
- flex实现经典的sticky footer布局
- sticky footer 布局
- sticky-footer布局
- CSS Sticky Footer 布局
- CSS Sticky Footer布局
- sticky footer布局
- css sticky footer布局
- Sticky footer布局
- sticky footer 布局
- sticky footer布局
- css sticky footer布局
- CSS Sticky footer布局
- Css Sticky footer布局
- Sticky Footer绝对底部的实现
- css sticky footer布局+流式布局
- Sticky footers布局的实现
- CSS Sticky footer完美底部布局
- #笔记 简单使用flex与sticky footer方式解决底部固定在底栏的问题
- 基于ant的jmeter自动化性能测试
- HDU 1224:Free DIY Tour
- hashmap与hashtable的一些知识点
- PAT (Basic Level) Practise (中文)1071. 小赌怡情(15)
- myeclipse中更改项目名称
- flex实现经典的sticky footer布局
- 机器学习-学习笔记(Java) 感知器(一)
- openvpn客户端安装
- 阿里云安装MySQL总结
- LeetCode 230. Kth Smallest Element in a BST
- 第三方类库-Core核心库-Google Guava-2
- VirtualBox中Linux设置共享文件夹
- Apache Beam核心--延迟和窗格设计
- [linux-shell]那些shell脚本中的符号: $0,$1,$(),${},$#,$?