Jump to content

visible scrollbar always


busnut

Recommended Posts

G'day, I need a bit of code so the scrollbar is always visible, even if its not needed. The reason for this is so the page doens't move over when the content goes beyond the bottom of the screen.

 

I've got some code, and works in most browsers, but found in IE6 and who knows what other old browsers, it displays the scrollbar twice.

 

this is what i've got:

body { font: 10pt Arial, Helvetica, sans-serif; overflow-y: scroll; background: url('background.jpg') repeat; }

Link to comment
Share on other sites

It's overflowing twice because something is pushing the containing HTML element beyond the browser's width, so the browser is adding a scroll bar for that.

 

Then you are telling it the body element always has a scrollbar as well.

 

Try taking the overflow out of your CSS above and apply it to the HTML tag instead:

/* css */
html { overflow-y: scroll; }
body { font: 10pt Arial, Helvetica, sans-serif; background: url('background.jpg') repeat; }

 

Or fix the issue that's causing the html element to be wider than the browser.

 

Just educated guesses by the way.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.