把div固定于页面脚部(代码)
2016-03-26 16:00
387 查看
暂时没时间编辑,直接上代码,以后再一一解释
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title></title>
<style type="text/css">
html,body{
height: 100%;
}
*{
padding: 0px;
margin: 0px;
}
.header,.footer{
font-size: 20px;
font-weight: 800;
width: 100%;
height: 60px;
line-height: 60px;
text-align: center;
color: white;
}
.header{
background: rgba(0,0,0,0.5);
margin-bottom: 10px;
}
.mian{
min-height: 100%;
height: auto !important;
padding-bottom: 60px;
height: 100%;
background: #CECECE;
}
.content{
background: #FFFFFF;
width: 90%;
margin: 0px auto;
box-shadow: 2px 0px 10px #000,
0px 2px 10px #000;
margin-top: 0px;
}
.footer{
background: #FF4F01;
position: relative;
clear:both;
margin-top: -60px;
}
</style>
</head>
<body>
<div class="mian">
<header class="header">
头部
</header>
<div class="content">
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />1
</div>
1
</div>
<footer class="footer">
脚部
</footer>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title></title>
<style type="text/css">
html,body{
height: 100%;
}
*{
padding: 0px;
margin: 0px;
}
.header,.footer{
font-size: 20px;
font-weight: 800;
width: 100%;
height: 60px;
line-height: 60px;
text-align: center;
color: white;
}
.header{
background: rgba(0,0,0,0.5);
margin-bottom: 10px;
}
.mian{
min-height: 100%;
height: auto !important;
padding-bottom: 60px;
height: 100%;
background: #CECECE;
}
.content{
background: #FFFFFF;
width: 90%;
margin: 0px auto;
box-shadow: 2px 0px 10px #000,
0px 2px 10px #000;
margin-top: 0px;
}
.footer{
background: #FF4F01;
position: relative;
clear:both;
margin-top: -60px;
}
</style>
</head>
<body>
<div class="mian">
<header class="header">
头部
</header>
<div class="content">
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />1
</div>
1
</div>
<footer class="footer">
脚部
</footer>
</body>
</html>
相关文章推荐
- Mybatis与Spring整合连接MySQL
- ubuntu源码编译安装php
- windows基础编程----第六篇(绘画出一个会动的矩形)
- jdk\willy\集群安装
- 编程两道——悼念2016.3.25模拟糟糕的模拟考
- Python 编程核心 - Chapter9练习
- 朴素贝叶斯算法(Naive Bayes)算法的python实现 含源代码
- 学习笔记整理之C#
- php如何创建验证码
- java之子类继承抽象类,子类构造器调用抽象类构造器问题
- JAVA两个大数相乘
- MATLAB中字符串数组的创建和引用
- String源代码
- 20145219 《Java程序设计》第04周学习总结
- 对java中int与Integer的一些理解
- PHP设计模式
- Java中的抽象类和接口
- Spring的依赖注入
- 解决GitHub安装失败
- 静态链表