CSS Sticky footer布局
2017-11-21 18:08
579 查看
stick footer就是让footer元素固定在底部,1当内容不足满屏时,footer紧贴最底部。2,满屏需要下拉时,footer就在内容的底部
通常用于提示的页面,下面有个x的按钮,这个按钮就是footer,它是用于关闭这个弹窗的,内容少时处在底部,多时下拉才显示。保证你都看完了。
html结构
css代码:
.bb{
height:32px;
background-color:#f1ee18;/所有识别/
.background-color:#00deff\9; /IE6、7、8识别/
+background-color:#a200ff;/IE6、7识别/
_background-color:#1e0bd1;/IE6识别/
}
通常用于提示的页面,下面有个x的按钮,这个按钮就是footer,它是用于关闭这个弹窗的,内容少时处在底部,多时下拉才显示。保证你都看完了。
html结构
<div class="detail"> <div class="detail-warpper clearfix"> <div class="detail-main"> 内容区域,随便写 </div> </div> <div class="detail-close">x</div> //始终在底部 </div>
css代码:
.detail{ position: fixed; //总容器为全屏铺满 超出出现滚动条 top: 0; left: 0; width: 100%; height: 100%; background: rgba(7,17,27,.8); overflow:auto; } .detail-warpper{ //内容不够长时保证也会显示全屏 min-height: 100%; width: 100%; } .detail-main{ margin-top: 64px; //向上和屏幕顶部保持64px像素 随便设置 padding-bottom: 64px; //保证内容区底部有空白区间 必须和footer是相同的高度 } .detail-close{ position:relative; height:64px; margin-top: -64px;//footer高度的负值 font-size: 32px; color:#fff; text-align: center; } .clearfix{ //用clearfix 主要是为了解决有的兼容问题 display: inline-block; } .clearfix:after{ display: block; content: ""; height: 0; line-height: 0; clear: both; visibility: hidden; }
.bb{
height:32px;
background-color:#f1ee18;/所有识别/
.background-color:#00deff\9; /IE6、7、8识别/
+background-color:#a200ff;/IE6、7识别/
_background-color:#1e0bd1;/IE6识别/
}
相关文章推荐
- 【css技能提升】完美的 Sticky Footer 布局
- CSS Sticky Footer布局
- css sticky footer 布局 手机端
- A CSS Sticky Footer——CSS底部固定布局分析
- CSS Sticky Footer 布局
- css sticky footer布局
- CSS高手布局:让footer完美处于网页下方
- css sticky footer 使用
- CSS Sticky Footer: 完美的CSS绝对底部
- CSS Sticky Footer
- 观看基于vue的仿饿了么关于sticky footer布局
- 【转载】CSS Sticky Footer: 完美的CSS绝对底部
- CSS Sticky Footer: 完美的CSS绝对底部
- CSS 万能的 sticky-footer 写法
- CSS&nbsp;Sticky&nbsp;Footer:&amp;nbs…
- sticky-footer布局
- css 简单布局 -- header, nav, left, center, right, footer
- CSS使用position:sticky 实现粘性布局
- 一道经典的css面试题。固定底部(sticky footer)
- css sticky footer