Results 1 to 2 of 2

Thread: Doesn't move when page is scrolled

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    Fredericton, NB, Canada
    Posts
    85

    Doesn't move when page is scrolled

    Hi,

    Alright, I want to place something at the top of a page and when the user scrolls down the page this stays at the top. A header of sort. Now, the thing is I don't want to use frames because I'd like to keep the entire form together to keep things less difficult...

    How would I do this?

    Thanks,

    Neil

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    The easy (and standard) way to do it is like so:

    CSS:
    Code:
    #ID {
      position: fixed;
      top: 0px
      left: 0px;
    }
    HTML:
    Code:
      <div id="ID">This should be at the top</div>
    But unfortunately IE (for Win at least) doens't support fixed positioning, so you'll have to use a javascript for that. Or alternatively if you just want it absolutely positioned you could do this:

    Code:
    #ID { position: fixed; }
    html>body #ID { position: absolute; }
    #ID {
      top: 0px
      left: 0px;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width