I too am new to web development and have just read the recent post regarding this problem which is exactly the same as I am experiencing. I have added the following to my style sheet but obviously doing something wrong as hasn't fixed it. Any pointers would be very greatly appreciated.

.html {
overflow: scroll;
}

My website is exsport.com.au

I viewed your site in Firefox, IE7, and Chrome, and do not see a sideways scrolling problem. It seems to be perfectly in the center of my screen. What browser do you see this problem in?

I am using Firefox 3.16.13

Give the elements a width and height.

Regards, Arkinder

Hello, thanks for all your comments. This problem only occurred recently when I added a new page 'In the press'. I started adding this item into the main menu bar and once I did, I noticed the pages jumping. I hadn't added any more content to the existing pages so the scroll bars on the more populated pages already existed. Given that, I'm not sure about giving the elements width and height. Many thanks again. Jenny.

The entire purpose of the overflow property is to accomodate overflow. If there is no overflow, then the property will do nothing.

Regards, Arkinder

Hi Arkinder,
Thanks for your note. Am a little confused as you may well have guessed. I have put the overflow code in my style sheet but doesn't seem to make a difference. Have I done this incorrectly? As mentioned before, I didn't have this problem until I added a new page just recently. Prior to that, I didn't have any of the jumping even though a number of the pages had scroll bars so I don't know what has changed.
Many thanks for your patience and kind regards,

Jenny.

It looks like from your original post that you have a period in fron of html. Is this the case? Do you have a class of .html in your html somewhere? Either way the desired affect you are wanting will not be achieved with .html {overflow: scroll;}

Remove the period to cause every page to have a scroll bar regardless of how much vertical content is in it.

Dear teedoff,
You are truly fabulous. I can't tell you how much I appreciate your help. I have spent ages trying to work this out and was something as simple as removing the period. Thank you so much and kind regards, Jenny

That's rather funny. There are elements with a class of html in the code, so I never bothered suggesting that or understood the question haha.


Regards, Arkinder

I never looked at the code lol but if you do have classes of .html, I recommend changing them. Gets confusing, at least to me, when you use id's and classes the same name as tags, case in point....lol

Either way I knew that to do what you were saying, then you needed to style the html TAG rather than any id or class of html.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.