SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Denver
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Top static panel

    I need to have a div at the top of my page with content that will be at a fixed position, meaning that it will display all the time and not be affected by vertic. scrolling. In other words, I would like to produce the same behavior as an iframe.How is this done using a div and css? please help.
    Note: I will also will be writing a JS function that will change the height of this div and shift everthing up (just incase if anything special needs to be done in css to allow this.) Thanks.

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    You can use:

    Code:
    div {position: fixed;
                    top: 0;
                     left: 0;}
    You need to declare height:100% for the body with overflow-y:auto to make this work for IE 6. Unfortunatley this causes all subsequent absolute/relative positioned elements appear fixed in IE 6 so beware using them after you've exploited this bug. Also i dont think this works for IE 5.

    Take a look at this at cssplay:

    http://www.cssplay.co.uk/layouts/fixed.html

    I will also will be writing a JS function that will change the height of this div and shift everthing up
    Im not overly sure what you mean by this bit could you clarify?
    Last edited by elduderino; Sep 16, 2006 at 05:19.


Bookmarks

Posting Permissions

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