Roger Roelofs wrote:
> Ingo,
> 
> On Jan 31, 2006, at 4:53 AM, Ingo Chao wrote:
> 
>> Don Hinshaw wrote:
>>> The basic page is here: 
>>> http://66.117.159.181/for_retailers_contact.php
>> Centering a bg-img with background-position: center top is apparently
>> different to centering a div with margin: 0 auto 0 auto, especially 
>> when
>> the viewport is sized to the width of the bg-img, or smaller.
> 
> Doesn't the spec say that background images which are centered will be 
> cropped on either side if the container is smaller than the image?  
> Conversely, elements that are centered via margin: 0 auto; remain 
> centered until they are wider than their container at which point they 
> act as though they were left aligned??
>

Hmm.

Don's bg image is center/top-positioned with regard to body. It is wider 
than it looks, there is 20px of green on both sides.
http://66.117.159.181/images/bkg_home.gif
w:800px h:200px

The browsers are showing a different behavior when the viewport gets 
smaller than 800px:

- Safari does not center the image like the others do, the image does 
not "move" relatively to the menu while the window is sized, like Opera 
and Fx do.

- When you resize the window to about 500px, and scroll horizontally to 
the right, Safari aligns the 760px blue bubbles part of the bg-image 
with the menu, but not Opera nor Fx. And the 20px of green is cropped, 
as you've said.

I must say I have always difficulties in interpreting what I see within 
the range of a window: do I see the body, the html, or something else?

I'd expect Opera and Safari shouldn't show any difference between the 
center-positioning of the bg-img and the margin: 0 auto; of a div when 
the window gets smaller than 800px, but they do center different, 0-1px off.

So sorry, I don't have an answer. Maybe I am just plain wrong.

Ingo

-- 
http://www.satzansatz.de/css.html
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to