SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Body Scrollbar

  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Body Scrollbar

    I am creating a friends site www.worldmusictime.co.uk

    I've aligned it to the center, but some pages are longer than the window and others are not. This results in the positioning to be out when the scollbar is there or not.

    Can I get the body's scrollbar to appear on all pages so it aligns in the same place on every page?

    I tried body{overflow-x:scroll; } but it doesn't work in Firefox, which is my friends main browser.

    Thanks,

    Mark

    Edit:


    Just tried {overflow:scroll;overflow-y:hidden} and the side scrollbar is there on all pages, but so is the bottom scrollbar.

    tried to make the body's height 110% but that didn't wotk either.
    Thanks
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,376
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    HI Mark,

    As ie displays the scrollbar at all times then ie shouldn't be a problem. For mozilla you could simply set the min-height to 100.1%.

    Code:
    html,body {min-height:100.1%}
    Or you can use some proprietary moz property:
    Code:
    html{overflow:-moz-scrollbars-vertical}
    However, the overflow-y (and x) property is to become valid css so I assume the moz code above may not remain.

    So its probably safer to use the min-height version which is valid code.

    Paul

  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, Works perfectly
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


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
  •