Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Probably a very simple CSS question

  • 05-05-2009 05:54PM
    #1
    Registered Users, Registered Users 2 Posts: 9,383 ✭✭✭


    I'm currently working on a basic centre aligned site and have a small issue.

    What's the best way to stop the slight shift in my layout that occurs when viewers navigate from a short page with no scroll bar to a long page where the scroll bar leads to a slight change in the browser window size?

    Any help would be great,


Comments

  • Closed Accounts Posts: 1,200 ✭✭✭louie


    unfortunately none.... or get a bigger screen with the "right" height.


  • Registered Users, Registered Users 2 Posts: 8,070 ✭✭✭Placebo


    why dont you use something like iframes or a div for longer pages so scroll bar appears inside the main content box


  • Registered Users, Registered Users 2 Posts: 2,119 ✭✭✭p


    This is just in Firefox, right. The easiest way is to force scroll bars by making the site automatically too high. Something like this will do the trick:
    body {
    min-height: 101%;
    }


  • Registered Users, Registered Users 2 Posts: 9,383 ✭✭✭S.M.B.


    It's obviously not that simple then, i suppose it now makes sense why i haven't come across a solution for the problem before.

    Thanks for the suggestions anyway.


  • Registered Users, Registered Users 2 Posts: 2,119 ✭✭✭p


    eh... did you try my suggestion?


  • Advertisement
  • Moderators, Society & Culture Moderators Posts: 25,619 Mod ✭✭✭✭Dades


    If you add style this to your body tag, it adds a default scrollbar like in IE to FireFox.
    [HTML]overflow-y: scroll;[/HTML]

    You may need to find a way to hide that style from IE, however, as it might screw it up.

    G'luck!


  • Registered Users, Registered Users 2 Posts: 9,383 ✭✭✭S.M.B.


    p wrote: »
    eh... did you try my suggestion?
    Sorry about that, when I read your reply I picked it up as being a solution for firefox only and I'd have to look for some other solution for IE.

    I completely forgot that IE uses a default scroll bar. Shows you how much I try avoid using the browser.

    Thanks for the help.


Advertisement