stickey-footer实现footer固定页面底部
先看看实现效果:http://getbootstrap.com/2.3.2/examples/sticky-footer.html
当一个网页比较简单,内容比较少使得网页不足浏览器高的时候,为了显示更合理,我们希望让 footer 部分显示在浏览器的底部。即让页面内容刚好满屏,这样视觉效果会比较好。
我们页面内容布局是这样的:
<body>
<div id="wrap">
<div id="main">
</div>
</div> <div id="footer">
</div>
</body>
下面描述下用stickey-footer的实现方案:
/*
Sticky Footer Solution
by Steve Hatcher
http://stever.ca
http://www.cssstickyfooter.com
*/ * {margin:;padding:;} /* must declare 0 margins on everything, also for main layout components use padding, not
vertical margins (top and bottom) to add spacing, else those margins get added to total height
and your footer gets pushed down a bit more, creating vertical scroll bars in the browser */ html, body {height: 100%;} #wrap {min-height: 100%;} #main {overflow:auto;
padding-bottom: 180px;} /* must be same height as the footer */ #footer {position: relative;
margin-top: -180px; /* negative value of footer height */
height: 180px;
clear:both;} /*Opera Fix*/
body:before {/* thanks to Maleika (Kohoutec)*/
content:"";
height:100%;
float:left;
width:;
margin-top:-32767px;/* thank you Erik J - negate effect of float*/
} /* IMPORTANT You also need to include this conditional style in the <head> of your HTML file to feed this style to IE 6 and lower and 8 and higher. <!--[if !IE 7]>
<style type="text/css">
#wrap {display:table;height:100%}
</style>
<![endif]--> */
stickey-footer实现footer固定页面底部的更多相关文章
- css让footer永远保持在页面底部
案例1:仅仅保存在页面底部.不固定. 思路: html: <div class="body"> <header>我是头部</header> &l ...
- 让footer始终待在页面底部
1.把html和body的height属性设为100%;保证content的高度能撑满浏览器; 2.把#content的高度也设置为100% ,但是这里我们使用了“min-height”属性,而不是的 ...
- div footer标签css实现位于页面底部固定
Web页面的“footer”部分随着飘上来,处在页面的半腰中间,给视觉效果带来极大的影响,让你的页面看上去很不好看,特别是现在宽屏越来越多,这种现象更是常见,本文将介绍两种解决方案,需要了解的朋友可以 ...
- HTML中footer固定在页面底部的若干种方法
<div class="header"><div class="main"></div></div> <d ...
- 让footer固定在页面底部(CSS-Sticky-Footer)
让footer固定在页面底部(CSS-Sticky-Footer) 这是一个让网站footer固定在浏览器(页面内容小于浏览器高度时)/页面底部的技巧.由HTML和CSS实现,没有令人讨厌的h ...
- HTML5+CSS把footer固定在底部
在刚开始给网页写footer的时候,我们会碰到一个让人烦躁的问题:当页面内容太少时,footer显示在了页面中间,这是我们不希望出现的,我们希望它能够永远呆在底部,不管网页的内容是多还是少.下面的代码 ...
- CSS-设置Footer始终在页面底部
Footer顾名思义页脚,如果内容多的时候在底部时感官很好,但是当内容变少(无法撑开一屏的时候)footer不固定在底部,影响美观,对于已经从事前端工作的工作的来说应该是比价工作中入门级别的问题了,由 ...
- HTML 中使 footer 始终处于页面底部
通常在页面中,需要使页脚 footer 部分始终处于底部.当页面高度不够 100% 时, footer 处于页面最底部,当页面内容高于 100% 时,页脚元素可以被撑到最底部. 方法一:绝对定位 &l ...
- 【转载自W3CPLUS】如何将页脚固定在页面底部
该文章转载自:W3CPLUS 大漠的文章 http://www.w3cplus.com/css/css-sticky-foot-at-bottom-of-the-page 以下为全文 作为一个Web的 ...
随机推荐
- PAT-1010 Radix
1010 Radix (25 分) Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 1 ...
- python-两个图片相似度算法
# -*- coding: UTF-8 -*- """ 作者:zxj 版本:1.0 日期:19-3-24 """ import cv2 im ...
- 一份超全超详细的 ADB 用法大全
http://blog.csdn.net/u010375364/article/details/52344120
- Daily Scrumming* 2015.12.11(Day 3)
一.团队scrum meeting照片 二.今日总结 姓名 WorkItem ID 工作内容 签入链接以及备注说明 江昊 任务945 学习使用sass,学习的主要难点在于ruby环境的搭建.sass ...
- ElasticSearch 2 (15) - 深入搜索系列之多字段搜索
ElasticSearch 2 (15) - 深入搜索系列之多字段搜索 摘要 查询很少是简单的一句话匹配(one-clause match)查询.很多时候,我们需要用相同或不同的字符串查询1个或多个字 ...
- 2017-08-20 block,inline和inline-block概念和区别
display:inline.block.inline-block的区别 display:block就是将元素显示为块级元素. block元素的特点是: 总是在新行上开始: 高度,行高以及顶和底边距都 ...
- PHP 验证IP的合法性
php验证IP的合法性! function get_ip(){ //判断服务器是否允许$_SERVER if(isset($_SERVER)){ if(isset($_SERVER[HTTP_X_FO ...
- Linux学习之CentOS(二)----远程登录管理工具SecureCRT的使用
[声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/3 ...
- Memcache 监控
本文介绍zabbix.nagios.cacti对Memcache的监控 一:zabbix企业应用之固定端口监控memcache 一.在客户端 1.到/usr/loca/zabbix/conf/zabb ...
- MacOS 如何剪切文件
MacOS 如何剪切文件 MacOS 剪切文件 command + C 复制 command + V 粘贴 删除 & 粘贴 在 Windows中 Ctrl + X 是剪切,MacOS中没有剪切 ...