wahsaga: Background Image - Darstellungs- oder Userfehler

Beitrag lesen

hi,

Es hat mit dem Befehl "background-attachment:fixed;" zu tun, denn so bald ich den lösche zeigen's beide Browser an

background-attachment:fixed impliziert laut Spezifikation eine Ausrichtung der Position des Hintergrundbildes am Viewport, Zitat:

"background-position: [...]

If a background image is specified, this property specifies whether it is fixed with regard to the viewport ('fixed') or scrolls along with the containing block ('scroll')."

Der Firefox hält sich an diese Vorgabe - und deshalb siehst du dein Hintergrundbild im Zweifelsfalle nicht, Zitat:

"Even if the image is fixed, it is still only visible when it is in the content, padding or border area of the element. Thus, unless the image is tiled ('background-repeat: repeat'), it may be invisible."

Du hast das Bild in x-Richtung wiederholen lassen, und ausgerichtet wird es mit den Defaultwerten für background-position (sofern du diese nicht noch überschrieben hast), und die sind 0% 0% - und beziehen sich jetzt, s.o., auf den Viewport.

  • jedoch bleibt das Bild dann im IE nicht an der Position und scrollt mit...

Tja, da darf man ihm vermutlich noch nicht mal einen Vorwurf machen.

CSS 2.0 sagte zu background-attachment,

"User agents may treat 'fixed' as 'scroll'. However, it is recommended they interpret 'fixed' correctly, at least for the HTML and BODY elements, since there is no way for an author to provide an image only for those browsers that support 'fixed'."

fixed als scroll zu interpretieren, macht er m.W. - und für html/body setzt er es ja korrekt um.

CSS 2.1 wird diesbezüglich noch etwas genauer,

"User agents that do not support 'fixed' backgrounds (for example due to limitations of the hardware platform) should ignore declarations with the keyword 'fixed'. For example:

body {
  background: white url(paper.png) scroll; /* for all UAs */
  background: white url(ledger.png) fixed; /* for UAs that do fixed backgrounds */
}"

Dieses Beispiel halte ich aber für redundant, denn scroll ist der Default - wenn ein UA, der fixed nicht versteht, es also ignoriert, dann sollte er auch ohne vorherige explizite Definition auf scroll zurückfalen.

gruß,
wahsaga

--
/voodoo.css:
#GeorgeWBush { position:absolute; bottom:-6ft; }