Css 使页脚粘在页面底部
我正在制作一个带有一些代码的nghtmare,应该很简单,但事实证明并非如此 我希望我的页脚贴在页面底部,但所有内容都放在第一位(如果有超过一个页面的价值,如果有意义的话) 我已经能够在Safari、Chrom和Firefox中做到这一点,但令人惊讶的是,Internet Explorer被证明是主要问题 我现在正处于底部,但是当有很多页脚时,页脚会出现在页面内容上方(请参见“我们是谁”选项卡) 我真的很感激在这个问题上的任何帮助,因为它真的开始让我恼火了,现在已经有好几个小时一直在修改代码了 下面是页面附带的CSS,正如我所说的,在此方面的任何帮助都将不胜感激Css 使页脚粘在页面底部,css,sticky-footer,Css,Sticky Footer,我正在制作一个带有一些代码的nghtmare,应该很简单,但事实证明并非如此 我希望我的页脚贴在页面底部,但所有内容都放在第一位(如果有超过一个页面的价值,如果有意义的话) 我已经能够在Safari、Chrom和Firefox中做到这一点,但令人惊讶的是,Internet Explorer被证明是主要问题 我现在正处于底部,但是当有很多页脚时,页脚会出现在页面内容上方(请参见“我们是谁”选项卡) 我真的很感激在这个问题上的任何帮助,因为它真的开始让我恼火了,现在已经有好几个小时一直在修改代码了
* {
border:0px;
margin:0px;
padding:0px;
}
#html {
height:100%;
}
#banner {
padding: 5px 0px 10px 0px;
}
#container {
width:970px;
margin:0 auto;
height: 100%;
position: relative;
}
#wrapper {
position: relative;
min-height: 100%;
}
#nav {
margin-left:0px;
text-indent:0px;
text-align:center;
}
#menutab li {
display:inline;
list-style-type:none;
font-family:Arial;
font-size:18px;
font-weight:100;
text-align:center;
}
#menutab a {
color:#9ea3ab;
padding:5px 32px 5px 32px;
text-decoration:none;
text-align:center;
}
#menutab b {
color:#9ea3ab;
padding:5px 0px 5px 0px;
text-decoration:none;
text-align:center;
}
#menutab a:hover {
color:#28957f;
}
#social .socialImage{float:right;
}
.divFloat {
float:right;
padding:0px 5px 0pc 0px;
}
.clear {
clear:both;
}
#social {
background:transparent;
}
#footer {
Position:fixed;
bottom:0;
width:970px;
height:45px;
background-image:url(images/footer.gif); width:970px; height:45px;
}
#footermenu .footermenu{float:right;
}
#footermenu li {
display:inline;
font-family:Arial;
list-style-type:none;
font-size:16pt;
}
#footermenu a {
color:#9ea3ab;
font-family:Arial;
padding:0px 5px 0px 0px;
text-decoration:none;
text-align:right;
}
#footermenu a:hover {
color:#28957f;
}
.clearfooter {
height:45px;
clear:both;
}
#address {
color:#28957f;
font-family:Arial;
font-size:16px;
text-indent:5px;
}
#address2 {
color:#9ea3ab;
font-family:Arial;
font-size:14px;
text-indent:5px;
}
#contentbackground {
background-image:url("images/homebackgroundimage.gif"); width:970px; height:400px;
}
#contentbackgroundcontact {
background-image:url("images/contactbackgroundimage.gif"); width:970px; height:330px;
}
#contentbackgroundyouth {
background-image:url("images/youthbackgroundimage.gif"); width:970px; height:350px;
}
#contectbackgroundwhoweare {
background-image:url("images/whowearebackgroundimage.gif"); width:970px; height:700px;
}
#contentbackgroundmusic {
background-image:url("images/musicbackgroundimage.gif"); width:970px; height:360px;
}
#contentbackgroundbrand {
background-image:url("images/brandbackgroundimage.gif"); width:970px; height:500px;
}
#content {
color:#9ea3ab;
font-family:Arial;
font-size:14px;
padding:5px 30px 5px 50px;
text-decoration:none;
text-align:top;
}
#content2 {
color:#9ea3ab;
font-family:Arial;
font-size:14px;
padding:5px 30px 5px 70px;
text-decoration:none;
text-align:top;
}
#contentcontact {
color:#9ea3ab;
font-family:Arial;
font-size:16px;
padding:5px 30px 5px 50px;
text-decoration:none;
text-align:top;
}
h1 {
color:#9ea3ab;
font-family:Arial;
font-size:16px;
padding:5px 30px 5px 35px;
text-decoration:none;
text-align:top;
}
body {
height: 100%;
background-image:url("images/denimbackground.gif"); repeat;
}
如果我删除#footer CSS指令中的position:absolute,则对我有效。
包括在IE中。请只发布相关代码。对不起,但我相信我也能在FF和Chrome中看到问题。我不相信这只是X浏览器兼容性的问题。如果你把这段代码放到网上会更好。只有在这里发布相关代码,当我遵循阿兰的指示时,才会在这里显示相同的结果。:)