开发者

CSS - position fixed and bottom

If you turn off javascript on stackoverflow you will see the noscript-warning on the top

#noscript-warning {
font-family:Arial,Helvetica,sans-serif;
position:fixed;
top:0;
left:0;
width:100%;
z-index:101;
text-align:center;
font-weight:bold;
开发者_如何学Cfont-size:120%;
color:#fff;
background-color:#AE0000;
padding: 5px 0 5px 0;
}

Question. How to position the alert on bottom of browser?


CSS:

bottom: 0;


See Fixing position:fixed for Internet Explorer for tips on IE compatibility in either top or bottom positioning. Particularly, it's ugly when bottom positioned block scrolls up with the content, instead of staying fixed as expected.


Forgetting about browser support, change:

top:0;

to

bottom:0;


bottom:0; should do the trick.

Just remove top:0;.


Put

html
{
    height: 100%;
}

in your CSS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜