sticky footer布局
来源:互联网 发布:linux on android 编辑:程序博客网 时间:2024/06/05 09:41
sticky footer布局(粘在底部)
两种思路
第一种:
按照下面的布局,设置外层容器的width和height都为100%。
设置.wrapper的最小高度为100%
设置内容底部的padding-bottom为64px.
设置footer的margin-top为-64px.这样就相当与是footer一直贴在内容区域的最底部。
> html <div class="container"> <div class="wrapper"> <div class="main">文字</div> </div> <div class="footer">X</div> </div>> css .container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; } .wrapper { width: 100%; min-height: 100%; } .main { padding-bottom: 64px; } .footer { margin-top: -64px; }
第二种:
flex布局,只需要四行代码,就搞定了,但是只兼容ie10+.
> html <div class="container"> <div class="content"> 内容 </div> <footer> <p>© 2017 sticky footer布局 学习代码</p> </footer> </div>> css .container { display: flex; flex-flow: column; min-height: 100vh; } .content { flex: 1; }
阅读全文
0 0
- 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布局
- css sticky footer布局+流式布局
- CSS Sticky footer完美底部布局
- flex实现经典的sticky footer布局
- Sticky Footer
- sticky footer
- css sticky footer
- 正则表达式-匹配标点符号
- 阿里云服务器通过ip不能访问
- 剑指Offer-旋转数组的最小数字
- 引水入城解题报告
- Spring的核心机制:依赖注入
- sticky footer布局
- HDU6070(线段树)
- 6、线程的同步
- 数据类型CString转为string
- JAVA中next()与nextline()的区别
- 剑指Offer-栈
- ui后台设计
- 概率密度生成例子scipy.stats.gaussian_kde用法
- Flume之监控