busnut Posted August 6, 2009 Share Posted August 6, 2009 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; } Quote Link to comment Share on other sites More sharing options...
Hybride Posted August 6, 2009 Share Posted August 6, 2009 I don't think you need the "overflow-y", it's actually just "overflow", and make sure to specify the width of your body, ie "width: #px". Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted August 6, 2009 Share Posted August 6, 2009 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. Quote Link to comment Share on other sites More sharing options...
busnut Posted August 6, 2009 Author Share Posted August 6, 2009 Tried both suggestions, neither worked sorry. The last one mentioned actually put scrollbars on every little thing on the page in IE6 Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted August 7, 2009 Share Posted August 7, 2009 Why don't you make the bottom-margin for the body really big so that the scrollbar will always exist? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.