开发者

Fixing the footer to the bottom of the browser

开发者 https://www.devze.com 2022-12-11 15:09 出处:网络
Is there any way we can fix the footer to the bottom of the window 开发者_如何转开发even at the time of vertical scroll.I have gone through some examples, but those never work with the vertical scroll

Is there any way we can fix the footer to the bottom of the window 开发者_如何转开发even at the time of vertical scroll. I have gone through some examples, but those never work with the vertical scroll.


Check out the sample and its google code base


You can set the bottom property to 0. Example:

.footer
{
    background-color:#FFFACD;
    bottom:0;
    position:fixed;
    z-index:250px; 
}


Here is your css

html, body {height:100%;padding:0;margin:0;}
#footer {position:absolute;bottom:0;left:0;width:100%;background-color:#f00;}
#scrollingbody {overflow:auto;height:100%;}

Here is your html

<div id="scrollingbody">content goes here</div>
<div id="footer">here is footer</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消