css解决无论页面长短footer永远置底
2014-07-10 14:12
316 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>footer固定到页面底部</title>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<style type="text/css">
html,body{margin:0;padding:0;height:100%}
.container{min-height:100%;height:auto !important;height:100%;/*ie6不识别min-height,如上述处理*/position:relative;}
.header{background:#ff0;padding:10px;}
.page{width:960px;margin:0 auto;padding-bottom:60px;/*padding等于footer的高度*/}
.footer{position:absolute;bottom:0;width:100%;height:60px;/*footer的高度*/background:#6cf;clear:both;}
.left{width:220px;float:left;margin-right:20px;background:lime;}
.content{background:orange;width:480px;float:left;margin-right:20px;}
.right{width:220px;float:right;background:green;}
.clearfix:after,
.clearfix:before{content:"";display:table}
.clearfix:after{clear:both;overflow:hidden}
.clearfix{zoom:1;}
</style>
</head>
<body >
<div class="container">
<div class="header">这是头部</div>
<div class="page clearfix">
<div class="left">left sidebar</div>
<div class="content">main content</div>
<div class="right">right sudebar</div>
</div>
<div class="footer">footer section</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>footer固定到页面底部</title>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<style type="text/css">
html,body{margin:0;padding:0;height:100%}
.container{min-height:100%;height:auto !important;height:100%;/*ie6不识别min-height,如上述处理*/position:relative;}
.header{background:#ff0;padding:10px;}
.page{width:960px;margin:0 auto;padding-bottom:60px;/*padding等于footer的高度*/}
.footer{position:absolute;bottom:0;width:100%;height:60px;/*footer的高度*/background:#6cf;clear:both;}
.left{width:220px;float:left;margin-right:20px;background:lime;}
.content{background:orange;width:480px;float:left;margin-right:20px;}
.right{width:220px;float:right;background:green;}
.clearfix:after,
.clearfix:before{content:"";display:table}
.clearfix:after{clear:both;overflow:hidden}
.clearfix{zoom:1;}
</style>
</head>
<body >
<div class="container">
<div class="header">这是头部</div>
<div class="page clearfix">
<div class="left">left sidebar</div>
<div class="content">main content</div>
<div class="right">right sudebar</div>
</div>
<div class="footer">footer section</div>
</div>
</body>
</html>
相关文章推荐
- css让footer永远保持在页面底部
- css让footer永远保持在页面底部
- 关于Asp.net2.0下Div+Css页面布局样式失效的解决方法
- Struts2.0页面跳转css无效问题的解决方法
- 利用CSS使footer固定在页面底部
- 解决: Firefox一些页面绝大部门显示正常,但却永远加载不完的问题,页面一直在加载中
- 在Ext(Version2.2 和目前的Version3.1.1 Version3.2) 里面存在一个BUG,就是当设置了 stripeRows:true, 并没有出现斑马线的效果,解决的办法是在定义一个css类,放置在一个独立的css文件里面,页面加以引用。
- 关于Asp.net2.0下Div+Css布局页面样式实效的解决方法
- 【Web Trick 1】css解决页面居中
- 一段永远让div位于页面底部的css代码
- struts中Action跳转jsp页面图片.css乱----解决方法
- 使用css固定底部footer(解决内容不充实底部上移问题)
- 关于在后台调用Response.Writer();弹出框后页面css变化的解决方法
- 解决长文本撑破页面的css
- 解决长文本撑破页面的css
- 页面前台-用DIV+CSS让footer始终在底部
- 关于Asp.net2.0下Div+Css布局页面样式实效的解决方法
- 【转】DIV+CSS页面让footer始终在底部
- CSS控制DIV永远固定在页面底部
- Struts2.0页面跳转css无效问题的解决方法