bioneural.net site preferences

Accessibility

Toggle width/ text size:

style

Default/Alternate

Suits visual impairment, mobile devices

Styling

Change the theme:

layout

Sorry, this option is not enabled

Link behaviour

Links with an icon are off-site:

links

Right-click any link to optionally open in a new window or tab


 

Fix the IE6 horizontal scroll bug

Does your web page look OK when viewed with Safari (Mac) or Firefox (Mac or Win), but when viewed with Internet Explorer 6 (Win) it has a horizontal scroll bar that you can't explain?

This problem vexed me for a while. I was sure my XHTML code wasn't to blame. Or was it? I came across the answer here:

Microsoft Internet Explorer 6 has a known issue that gives hundreds of web site designers and programmers quite a headache. Even though you are convinced that your page's content is small enough and there are no wrong or missing tags in your source code, IE6 adds a horizontal scroll bar to your page... if there is some code found on your page that is not found in [the DTD file], most browsers will ignore it. However, Internet Explorer 6 behaves in a very special way: it shows a horizontal scroll bar.

The simplest way to fix this is to change your DTD reference from this (for example):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

...to this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

The effect on IE6's rendering of your page is miraculous:

Screenshot003

The price you pay for this? You will get a validation error: "no system id specified".

4 responses to Fix the IE6 horizontal scroll bug


  1. 1 John Heinen

    I only have the the problem with one particluar website at present, and it's not just that there is a horizonatal scroll bar. The bar is there because the page is shown too wide for my screen.

    I don't know if the suggested fix will have any effect. I'm not a techie, so now I have to find out where to find the DTD file and whether I feel it is something I ought to leave alone because I don't really know what I'm doing.

  2. 2 Bruce

    John, to edit the DTD reference you need to be able to edit the HTML that makes up a web page. If the page that is causing you trouble is not one that you can edit (i.e. because it's someone else's website) then you can't fix this bug yourself—but you could contact the webmaster and bring the problem to their attention.

    You can check whether there is a DTD reference in any page by choosing "View source" (or similar) in your browser. This may not be the problem; it's also worth checking that the page uses valid mark-up. Failing this, you might have to increase your screen resolution if possible.

  3. 3 David Levin

    Thanks for posting this! I've been suffering through this problem for a really long time now. One other solution that I've heard about that works for some people (but didn't work for me 100% of the time) was to use the css property overflow-x:none;. Thanks again.

  4. 4 Matt

    tnx, i¡ve been suffering too. The devil scroll.
    lol
    tnx again Bruce.

    Matt.

Something to say?

Comments may be moderated, are subject to spam filtering, and should be inoffensive and relevant to this post. Please disclose commercial interests.

Usable tags include <a href=""> <blockquote> <em>.