Welcome to WebmasterWorld Guest from 3.93.74.227

Forum Moderators: open

Message Too Old, No Replies

Scrollbar in Firefox and Netscape moves contents when it appears

     
5:20 pm on May 13, 2005 (gmt 0)

New User

10+ Year Member

joined:Apr 11, 2005
posts:16
votes: 0


Hi folks,

How ya all doing? Good I hope.

Anyways..

I have a page which is working well. The only minor problem I am experiencing is that when the contents of my pages extends past the bottom of the browser window a scrollbar appears (which is what I want). The problem being that the vertical scrollbar moves the contents of my page over to the left by however many px the scrollbar takes up. IE and Opera already have a scrollbar so it's not such a problem in those two.

Ideally I would like to get rid of the scrollbars in all browsers and somehow conpensate for this using html and css. Is this possible?

If not I would like to make the scrollbar stay where it is at all times. This would stop my pages contents from moving I guess.

Hope someone answers this,

rich

11:03 pm on May 13, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 2, 2004
posts:551
votes: 0


You can't control whether or not the scrollbar is there with css, but you can add a background layer that is as long as your longest page so that there is always a scroll bar on smaller resolutions. The problem is on short pages there will be blank space below the content. It kind of looks like you are keyword stuffing.
11:14 pm on May 13, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


In another thread encyclo offered this solution to forcing a scrollbar [webmasterworld.com]:

CSS:

#scroll {
position:absolute;
top:0;
bottom:-0.1px;
width:1em;
z-index:-1;
}

And (X)HTML:

<div id="scroll"></div>

Yes, it's a hack - but it's a helpful one.

10:52 am on May 14, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2004
posts:1497
votes: 0


I've not tried it but presumably something like:

html { overflow-y: scroll; }

would work?

4:09 pm on May 14, 2005 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9074
votes: 6


html { overflow-y: scroll; }

It should in Firefox 1.1, but

overflow-y
(and
overflow-x
) are not supported in the current 1.0 branch.
8:27 pm on May 14, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2004
posts:1497
votes: 0


Ah, OK :) I've only really use trunk builds so trying to work out what's in the branches proves difficult.
8:38 pm on May 14, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 28, 2002
posts:564
votes: 0


It's your page so you can obsess over it as much as you like. But I really wouldn't try to micromanage you pages to this extent if I were you. Presumably your pages have a liquid layout so the browsers and your pages are working as they should. If the content you want to be seen can be seen, nobody but you is going to worry about this.
10:31 pm on May 14, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


I would modify what you say Longhaired, in one respect. Visitors may not care, but clients most certainly can micro-manage the rendering minutiae, even while they throw major issues to the winds.
10:43 pm on May 14, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Oct 9, 2002
posts:245
votes: 0


Can't seem to find the original thread that provided this, but this works to force a scrollbar in Mozilla and is ignored by IE:

html {height: 100%;}
body {min-height: 101%;}