footer绝对定位但是不在页面最下边解决方案
方案一
html {
height: 100%;
} body {
position: relative;
min-height: 100%;
box-sizing: border-box;
padding-bottom: 80px; /* .footer 的高度,为 footer 占位 */
} .footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 80px;
}
方案二
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
html,body {
height: 100%;
margin: 0;
padding: 0;
} #container {
min-height: 100%;
height: auto !important;
height: 100%;
}
#page {
padding-bottom: 60px;/*高度等于footer的高度*/
}
#footer {
position: relative;
margin-top: -60px;/*等于footer的高度*/
height: 60px;
clear:both;
background: red;
} #header {
padding: 10px;
background: lime;
}
#left {
width: 18%;
float: left;
margin-right: 2%;
background: blue;
}
#content{
width: 60%;
float: left;
margin-right: 2%;
background: green;
}
#right {
width: 18%;
float: left;
background: blue;
}
</style>
</head>
<body>
<div id="container">
<div id="header">Header</div>
<div id="page" class="clearfix">
<div id="left">Left sidebar</div>
<div id="content">Main contentMain contentMain contentMain contentMain contentMain contentMain contentMain contentMain contentMain content Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus animi blanditiis, consequuntur dolorem ea eos magnam necessitatibus numquam, quaerat quia quod rem sint unde. Deserunt dolorum laboriosam minus repellat veniam! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium, adipisci architecto, blanditiis cumque doloremque, ea earum et maxime non pariatur quas quia quibusdam recusandae similique sit soluta tempora voluptas voluptate. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad autem ea impedit ut vel. Aut culpa exercitationem incidunt itaque non, nulla saepe voluptas. Inventore, molestiae perferendis provident quaerat ullam veniam.
pisicing elit. Accusamus cupiditate facilis fugit inventore iste itaque iusto modi, natus nobis numquam obcaecati odio odit optio ratione sit ullam veniam vero. Vero.
</div>
</div>
</div>
<div id="footer">Footer </div>
</body>
</html>
footer绝对定位但是不在页面最下边解决方案的更多相关文章
- div footer标签css实现位于页面底部固定
Web页面的“footer”部分随着飘上来,处在页面的半腰中间,给视觉效果带来极大的影响,让你的页面看上去很不好看,特别是现在宽屏越来越多,这种现象更是常见,本文将介绍两种解决方案,需要了解的朋友可以 ...
- JS中用execCommand("SaveAs")保存页面兼容性问题解决方案
开发环境:ASP.NET MVC,其他环境仅供参考. 问题描述:在开发中遇到这样的需求,保存页面,通常使用JavaScript的saveAs进行保存,各浏览器对saveAs支持,见下表. 代码一:初始 ...
- Vue 实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案
Vue实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案 by:授客 QQ:1033553122 开发环境 Win 10 Vue 2.9.6 node-v ...
- 常见的H5移动端Web页面Bug问题解决方案总汇
解决jquery ajax调用远程接口的跨域问题 首先,接口必须允许远程调用.这是后端或者运维的事情.你必须保证你得到的一个接口是允许远程调用的.否则,就没啥了. $.ajax({ type:'get ...
- Html5页面返回机制解决方案
需要处理的返回场景: 1.正常的a->b->c 2.页面上的按钮触发需要登陆 3.页面跳转需要登陆 4.页面上的可修改的部分(如选择地址,地址页面本身也是可以增删改查的) 整体的原则是原路 ...
- javascript移动端禁止页面滑动的解决方案
1 前言 移动端网页,发现ios平台的iphone或者ipad,网页可以上下左右移动,而Android版则不会.仅作为记录使用. 2 代码 var mo=function(e){e.preventDe ...
- 【其他】Windows 系统安装IIS 打开页面出现空白解决方案
部署IIS过程中遇到了一个奇怪的问题,就是怎么设置打开的页面都是一篇空白,IIS也没有任何报错,翻遍互联网好不容易找到了解决方法,今天就教给大家,希望大家不要走弯路.此方法Windows xp.7.8 ...
- jsp页面中文乱码解决方案
一.JSP页面中文乱码 在JSP页面中,中文显示乱码有两种情况:一种是HTML中的中文乱码,另一种是在JSP中动态输出的中文乱码. 先看一个JSP程序: <%@ page language=&q ...
- rem手机端页面自适应完美解决方案(最新)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
随机推荐
- Leetcode: Count The Repetitions
Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc&qu ...
- Leetcode: Serialize and Deserialize BST
Serialization is the process of converting a data structure or object into a sequence of bits so tha ...
- 【C#进阶】多播委托和委托数组像是一回事~
这个MathOperation类有三静态方法,参数都是double,并且没有返回值,考虑用Action<>() 这种预定义的委托哦 class MathOperations { publi ...
- HDU 1880 魔咒词典(字符串哈希)
题目链接 Problem Description 哈利波特在魔法学校的必修课之一就是学习魔咒.据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一 ...
- 夺命雷公狗-----React---15--三元运算符
<!DOCTYPE> <html> <head> <meta charset="utf-8"> <title></ ...
- PHPExcel--基本操作
下面是PHPExcel的导入与导出的基本操作,也是最重要的两个操作. 生成文件: <?php require_once './Classes/PHPExcel.php'; $content = ...
- 分布式入门之2:Quorum机制
1. 全写读1(write all, read one) 全写读1是最直观的副本控制规则.写时,只有全部副本写成功,才算是写成功.这样,读取时只需要从其中一个副本上读数据,就能保证正确性. 这种规则 ...
- DKIM对发送邮件的好处及使用方法
关于DKIM: What is DKIM? 简单的来说dkim有益于增加邮件服务供应商中的反垃圾邮件系统评分,减少邮件内容被评为垃圾邮件的概率. 但使用它不等同于不会被评为垃圾邮件.另外,邮件的发送次 ...
- Linux中的命令 make -f 是什么意思
出处:http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece7631046893b4c4380146d96864968d4e414c422460 ...
- PhpStorm创建Drupal模块项目开发教程(1)
用户体验是应用程序开发的一个重要因素.一个加载时间长.设计差.导航不清晰的网站很难留住客户. Web应用程序由多个部分组成,并且可能运行在多种环境中,所以Web应用程序从开发开始就需要在所有环境中进行 ...