Sticky footer acting weird

2019-08-01 06:00发布

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");

}

2条回答
对你真心纯属浪费
2楼-- · 2019-08-01 06:50

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!

查看更多
看我几分像从前
3楼-- · 2019-08-01 07:05
#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;
}
查看更多
登录 后发表回答