Layout: permanent position at the top of the screen

started by Bb on Jan 2, 2005 — RSS Feed

Bb Bb
Posts: 5

Can i manage to place something   at the top  of the scrren , wich remains  unmooved by scrolling? With CSS onely? Without javascript at all ? And  surely without frames/ Thank you

Stan Stan
Posts: 44

That can be done with CSS, but not all browsers support it.

Your CSS would be something like this:

#top  
{
position: fixed;
top: 0px;
}

Bb Bb
Posts: 5

STAN, thank you. But no such standard  at W3C !?  But why it would be nice to have CSS for screen . There is CSS for print  .

Baxter Baxter
Posts: 157

There is CSS for screen. Actually, if you describe no media, it defaults to screen anyway.

And yes, fixed positioning is a very, very simple way to get what you want. However, Internet Explorer doesn't support it (well, it does, but only on background items). If you look around for "IE fixed positiioning" or something like that, there's some brief javascript fixes for IE.

Bb Bb
Posts: 5

Thank you. I found javascript solutions and CSS walkarounds  http://devnull.tagsoup.com/fixed/

You must login to reply