Forum Moderators: open

Message Too Old, No Replies

weird IE reaction with DOCTYPE: loose.dtd

horizontal scrollbar always shown?

         

tata668

2:58 pm on Mar 5, 2005 (gmt 0)

10+ Year Member



I'm in a simple two horizontal frames frameset.

I use the doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

As soon as the text in the upper frame overflows vertically, both scrollbars are shown in IE, the vertical AND horizontal scrollbars.
Why does it show a horizontal scrollbar? Is there a way to prevent this?
In Firefox and Opera only the expected vertical scrollbar appears.

-------
frameset
-------

<html>
<head>
</head>
<frameset rows="*,22" border="0">
<frame name="board" src="up.html" frameborder="0">
<frame name="bar" src="bottom.html" frameborder="0" noresize>
</frameset>
</html>

-------
up.html
-------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
hi there <br/>
hi there <br/>
hi there <br/>
hi there <br/>
(... enough to overflow vertically)
</body>
</html>

tata668

3:05 pm on Mar 5, 2005 (gmt 0)

10+ Year Member



For the records, IE also shows the horizontal scrollbar when using:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

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

It doesn't when using no doctype at all or with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

tata668

3:30 pm on Mar 5, 2005 (gmt 0)

10+ Year Member



Found a solution!

A thread about the same problem: [lists.evolt.org...]

Solution:
[lists.evolt.org...]

So setting my body's width to 95% did the job:

body
{
width:95%;
}

tedster

8:08 pm on Mar 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've run into that IE bug, too - it shows up even in non-framed pages.

IE's rendering engine seems, at times, to assume that the vertical scrollbar space is PART of the available width, which makes another part of the rendering engine think you need a horizontal scroll bar when you don't. The body {width:95%;} usually gets rid of the scrollbar problem, but sometimes that bug fix messes with other elements in the layout.

kaled

11:18 am on Mar 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



body {width:95%} will add a right-hand margin of 50 pixels on a 1024 wide screen.

You may be able to fix the problem by reverting to quirks mode. To do this remove the url from the doctype. This fixes the problem on most of my site but there are still a few rogue pages.

Of course, using quirks mode may be out of the question.

Kaled.