本文主要是介绍div显示在底部(一种固定不变,另一种随页面上下翻动而动),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<html><head>
<style type="text/css">
html, body, #wrap{ height: 100%; width:100%;padding:0px; margin:0px;}
#main{padding-bottom: 0px;}
/* 必须使用和footer相同的高度 */
#footer
{
left:0px;
right:0px;
position: relative;
margin-top: -0px; /* footer高度的负值 */
height: 150px;
background: #ddd;
clear: both;
padding:0px;
}
.clearfix:after
{
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix
{
display: inline-block;
}
/* Hides from IE-mac \*/
* html .clearfix
{
height: 1%;
}
.clearfix
{
display: block;
}
</style>
</head>
<body>
<div id="wrap">
<div id="main" class="clearfix">
<div id="content">
ccc
</div>
<div id="side">
sss
</div>
</div>
</div>
<div id="footer">
fff
</div>
asdfasdfasdf
<div style="position:fixed;bottom:0px;right:0px; background-color:Red; width:100%;">
HHHHHHHHHHHHHH
</div>
asdfasdfasd
</body>
</html>
转自:http://www.cnblogs.com/mrray/archive/2011/11/08/2241563.html
这篇关于div显示在底部(一种固定不变,另一种随页面上下翻动而动)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!