Forum Moderators: open

Message Too Old, No Replies

IE6 and Scrollbars

Not related to horizontal ones!

         

thorevenge

2:42 am on Jul 26, 2005 (gmt 0)

10+ Year Member



So using <body scroll="auto"> solves the error of the right hand scroll bar being present in ie 6, *BUT* the damn space is still reserved for it!

This more or less means that my site looks stupid in ie 6! Firefox renders beautifully, but ie renders the iframe with a horizontal scrollbar because the space the content needs at 100% is occupied by the absent scrollbar.

Anyone else ever seen this before?

A good example of what I mean is

<html>
<head>
<title>Test Page</title>
</head>
<body scroll="auto" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"

marginwidth="0" marginheight="0">
<table width="100%">
<tr>
<td width="100%" bgcolor="#AD0000" cellspacing="0" cellpadding="0">
</td>
</tr>
<tr>
<td>
This is a test page to see if IE really does suck.
</td>
</tr>
</table>
</body>
</html>

And you will see the red bar doesnt stretch all the way across the page and there is space reserved for the scrollbar that is absent.

How do I get rid of it?

Argh! IE and standards!

Hester

8:31 am on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's pretty old school code. Try this instead. (Avoid inline code in favour of CSS if you can.) I'm not sure if scroll is the same as overflow though? Also scroll is meant for frames, but you were using it on the body element...

<html>
<head>
<style>
body {overflow:auto}
body, table {margin:0; padding:0;}
table {width:100%;}
.test {background-color:#ad0000;}
</style>
<title>Test Page</title>
</head>
<body>
<table>
<tr>
<td class="test">&nbsp;</td>
</tr>
<tr>
<td>
This is a test page to see if IE really does suck.
</td>
</tr>
</table>
</body>
</html>

thorevenge

11:49 am on Jul 26, 2005 (gmt 0)

10+ Year Member



So that might work, but will it remove the space that IE reserves for the scrollbar that scroll="auto" does remove, at least visually?

Oh and I do use css, that was just something I found that I thought was going to provide a quick fix solution.

Stupid me, Micro$oft software, quick fix solution... hahahaha

dmorison

1:56 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was under the impression that most people prefer the IE implementation of constantly reserved space for the vertical scroll bar.

By not reserving space, other browsers effectively make canvas width a function of canvas height, which can result in some very ugly shuffling behaviour if some pages extend below the window height whilst others do not.

thorevenge

1:13 am on Jul 27, 2005 (gmt 0)

10+ Year Member



Well it did work for what I wanted... so thank you!

As to reserving space, as far as I can tell, considering on the actual site that I am building, where content is fluid almost down to 800x600 (I made a mistake with an image somewhere) that space reserved for a scrollbar was causing some interesting issues concerning the use of an iframe.

Simply put, the content within the iframe was set at 100%, however the space of that scrollbar, which Firefox will only render if it needs a scrollbar unlike IE which defaults to having that space there, saw a horizontal scrollbar on the iframe that wasn't necessary. With the removal of this scrollbar, the content fits the page correctly and the horizontal iframe scroll disappears.

Once again, thank you very much.