I've worked and fiddled with CSS for quite some time now but I recently discovered a new "oddness" with 100% widths and I.E. that I hadn't had need to come across before. I was wondering if anyone was familiar with this and even new a work around for I.E.

I've been investigating the possibility of a layout with both a mid page navigation bar and a footer that bleeds to the full width of the screen. To help visualise what I am talking about you can look at this with Mozilla.
http://www.mtod.co.uk/cssexp

Now in developing this I noted a couple of things:

In both Moz & I.E 100% width actually leaves a small border at the edge of the page. This can be fixed for Mozilla by using position: absolute and left: 0px. Forcing the block to the absolute edges.

In I.E. this solution left an even bigger "gap" at the right hand side. So just playing around with my browsers set at 1024 resolution I discovered that giving 100% widht to Moz & 102% width to I.E. forced the block to both edges in both browsers.

Now at this point I thought I had been quite clever until I started resizing the I.E. browser. Now you see I.E. seems to be dynamically altering this percentage as the page resizes down to smaller screen sizes. As you make the browser window smaller a gap appears on the right hand side, the smaller you go the larger the gap gets.

Just open my example http://www.mtod.co.uk/cssexp in I.E. and drag the browser around a bit to see what I mean.

OK, I'm sorry this was so long & I hope I've explained myself properly. Has anyone got any clue how to gt I.E. to behave itself here or have I just found another brick wall to bang my head against?

Thanks in advance :)

coothead

11-23-2005, 11:38 AM

Hi there mattyod,

There is no need to use absolute positioning for this. :eek:
Just set body margins and padding to 0px.....

Besides that, divs should have default "width: auto;" which should make 'em fill the available horizontal space to the brim anyway--provided they're left in the normal flow, that is.

mattyod

11-23-2005, 02:34 PM

aha thank you. It hadn't occured to me that the problem could be with padding & margins on the main body.

There is still a tiny quirk with this method in that if you squish the I.E. browser so that it doesn't cover the full height of the content (the 3 colorod lines in this case) then suddenly a horizontal scroll bar appears and the content becomes slightly wider than the visible area.

Removing the "overflow:auto" from the html section fixes this. What does that line do exactly?