Sticky footer acting weird

萝らか妹 提交于 2019-12-11 11:41:56

问题


I have made a sticky footer for my website, but it doesnt act like i want i to. I want it to be totally at the bottom, always depending on the length of the content. Instead it is always present on screen, as it is. Can anyone help me ?

This site

footer css:

#footer{
position: fixed;
bottom: 0;
z-index: 1;
width: 100%;
height: 50px;
clear: both;
background-image: url("../images/footer_pattern.png");

}


回答1:


#footer{
width: 100%;
height: 50px;
clear: both;
background-image: url("../images/footer_pattern.png");
display: block;
margin-top: 0px;
//if contains children add overflow:hidden;
}



回答2:


Your question is a little vague, but if I understand correctly I think what you are looking for is position:relative.

position: relative;
bottom: 10px;

what this does is it adds a specified amount of space (10px) in between the element and the next relative parent element. Good Luck!



来源:https://stackoverflow.com/questions/11847571/sticky-footer-acting-weird

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!