views:

145

answers:

2

Hi,

I have just finished redesigning this site (www.imustsolutions.co.za) and I have a problem with the header and the footer when the user zooms in (Cntrl + in FF).

Here is the problem: The background color of the footer/header does not paint to fill the rest of the screen (horizontally) when the user zooms in.

What am I doing wrong?

Here is the site again: www.imustsolutions.co.za

Thanks in advance.

Regards, M

A: 

That's basically how it's supposed to work. The width of a block-level element is determined by the width of its containing block. And the width of the initial containing block (i.e. the containing block of the html element) has the dimensions of the "viewport" (i.e. the browser window).

In other words, unless you've explicitly set widths on your blocks to make them wider than the viewport, they'll never be wider than the viewport.

You can see the same thing happening on the footer of StackOverflow itself too, for example: if you zoom in on this page until you get a horizontal scrollbar and then scroll sideways, you'll see the gray background chopped off too.

One way you could fix this is by turning the entire page into a float, since the width of floating elements shrinks to fits the dimensions of its contents and isn't contrained by the dimensions of the viewport.

Simply adding float: left to the html or body tag should do the trick. I haven't tested that in all browsers, though.

mercator
A: 

@Pekka, c0mrade and Allan thank you all for testing my problem.

Mercater thanks a lot for the idea. I will test it tonight.

Thanks again, M