让页脚footer永远固定在页面的底部,而不是永远固定在显示器屏幕的底部的方法
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html,body {
height: 100%;
padding: 0;
margin: 0;
text-align: center;
} #container {
min-height: 100%;
position: relative;
}
.header {
line-height: 80px;
font-size: 60px;
height: 80px;
background-color: #eee;
}
.body {
font-size: 40px;
padding-bottom: 80px;
}
.footer{
line-height: 80px;
height: 80px;
width: 100%;
font-size: 60px;
position: absolute;
background-color: #eee;
bottom: 0;
}
</style>
</head>
<body>
<div id="container">
<div class="header">header</div>
<div class="body">
body<br>body<br>body<br>body<br>body<br>
</div>
<div class="footer">footer</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html,body {
height: 100%;
padding: 0;
margin: 0;
text-align: center;
} .header {
line-height: 80px;
font-size: 60px;
height: 80px;
background-color: #eee;
position: fixed;
left:0;
right:0;
}
.body {
font-size: 40px;
padding-bottom: 80px;
min-height: 100%;
box-sizing: border-box;
padding-top:80px;
margin-bottom: -80px;
}
.footer{
line-height: 80px;
height: 80px;
width: 100%;
font-size: 60px; background-color: #eee; }
</style>
</head>
<body> <div class="header">header</div>
<div class="body">
body<br>body<br>body<br>body<br>body<br>
</div>
<div class="footer">footer</div> </body>
</html>
让页脚footer永远固定在页面的底部,而不是永远固定在显示器屏幕的底部的方法的更多相关文章
- Jquery EasyUI的datagrid页脚footer使用及数据统计
最近做一个统计类的项目中遇到datagrid数据显示页脚footer合计的问题,对于构造统计结果数据格式,是在程序端构造一个{"rows":[],"total" ...
- 网页布局中页面内容不足一屏时页脚footer固定底部
方法一:给html.body都设置100%的高度,确定body下内容设置min-height有效,然后设置主体部分min-height为100%,此时若没有header.footer则刚好完美占满全屏 ...
- 【转载自W3CPLUS】如何将页脚固定在页面底部
该文章转载自:W3CPLUS 大漠的文章 http://www.w3cplus.com/css/css-sticky-foot-at-bottom-of-the-page 以下为全文 作为一个Web的 ...
- 将HTML页面页脚固定在页面底部(多种方法实现)
当一个HTML页面中含有较少的内容时,Web页面的footer部分随着飘上来,处在页面的半腰中间,给视觉效果带来极大的影响,接下来为大家介绍下如何将页脚固定在页面底部,感兴趣的朋友可以了解下 作为一个 ...
- 如何将页脚固定在页面底部,4中方法 转载自:W3CPLUS
原博客地址:http://www.w3cplus.com/css/css-sticky-foot-at-bottom-of-the-page 作为一个Web的前端攻城师,在制作页面效果时肯定有碰到下面 ...
- GridView Footer页脚统计实现多行
在使用GridView时有时会需要多行显示页脚Footer的统计,下面是一种解决方法,仅仅供各位参考 在GridView的RowCreated事件中添加多行页脚,实例代码如下: protected v ...
- openxml(二) 添加页眉,页脚
openxml 中 word 文档的结构是如下图: 其中,页眉是 header,属于headerpart 部件,页脚是footer,属于footerpart 部件,图上还有其他的东西,之后会一一介绍. ...
- 使用Bootstrap 3开发响应式网站实践07,页脚
页脚部分比较简单,把一个12列的Grid切分. <footer> <div class="container"> <div class="r ...
- Sticky Footer (让页脚永远停靠在页面底部,而不是根据绝对位置)
<!doctype html><html> <head> <meta charset="UTF-8"> <meta name= ...
随机推荐
- 初涉JavaScript模式 (2) : 基本技巧
尽量少用全局变量 大量使用全局变量会导致的后果 全局变量创建以后会在整个JavaScript应用和Web页面中共享.所有的全局变量都存在于一个全局命名空间内,很容易发生冲突 不知不觉创建了全局变量 其 ...
- TP开发小技巧
TP开发小技巧原文地址http://wp.chenyuanzhao.com/wp/2016/07/23/tp%E5%BC%80%E5%8F%91%E5%B0%8F%E6%8A%80%E5%B7%A7/ ...
- json数组对象和对象数组(转)
转自:http://www.cnblogs.com/zhangji/archive/2011/09/02/2163811.html 一.Json的简单介绍 从结构上看,所有的数据最终都可以分成三种类型 ...
- Dapper快速学习
Dapper快速学习 我们都知道ORM全称叫做Object Relationship Mapper,也就是可以用object来map我们的db,而且市面上的orm框架有很多,其中有一个框架 叫做dap ...
- 【问题】tableView的每组的头部不不能滚动的解决方案
group模式的解决方案 - (void)scrollViewDidScroll:(UIScrollView*)scrollView { if (scrollView == self.tableVie ...
- Swift互用性:与 Objective-C 的 API 交互(Swift 2.0版更新)-备
本页包含内容: 初始化 可失败初始化 访问属性 方法 id 兼容性(id Compatibility) 空值和可选值 扩展(Extensions) 闭包(Closures) 比较对象 Swift 类型 ...
- 重构前的程序:通过rsync命令抓取日志文件
基本概况: 我有一台服务器每天每个小时都会生成一个日志文件,这些日志文件会被保留2天,超过2天会被一个程序压缩放到备份目录,日志文件的文件名是有命名要求的,例如:project_log.2013010 ...
- phonegap apk
在 Windows 中自动生成 Cordova/Phonegap for Android 的 APK 安装程序本贴首发于:http://xuekaiyuan.com/forum.php?mod=vie ...
- 异步导入导出Redis数据(利用Hiredis、Libevent)
最近工作中需要用到一个将数据从Redis导出到文本(或从文本导入Redis)的工具.找到一个用Ruby写的开源软件redis-dump(http://delanotes.com/redis-dump/ ...
- Milking Grid
poj2185:http://poj.org/problem?id=2185 题意:在一个字符矩阵中,找一个最小的字符子矩阵,使其能够覆盖整个矩阵. 题解:在KMP中i-next[i]是这能够覆盖这个 ...