flo: CSS: overflow:scroll & background-attachment:scroll

Ich habe ein Problem mit dem background-image eines <div>-Containers.
Der Style des <div> ist wie folgt definiert:

div#content_anzeige_gross{  
	background-color:#FFFFFF;  
	background-image:url(../gfx/balken_blau.png);  
	background-position:top left;  
	background-repeat:repeat-x;  
	border:1px solid #002D96;  
	height:500px;  
	overflow:scroll;  
	position:absolute;  
	top:119px;left:3px;  
	width:180px;  
}  

Wie man an dem overflow:scroll schon erkennen kann, soll der Container bei übergroßem Inhalt scrollbar sein, was auch wunderbar funktioniert. Leider bis auf die Tatsache, dass das background-image (es ist ein blauer Balken an der Oberseite des <div>) nicht mitscrollt. Laut selfhtml müsste dieses Problem mit background-attachment:scroll lösbar sein. Bei mir funktioniert das aber leider weder mit FF 3.0.13 und mit IE 8 nur in der Kompatiblitätsansicht...

  1. Laut selfhtml müsste dieses Problem mit background-attachment:scroll lösbar sein. Bei mir funktioniert das aber leider weder mit FF 3.0.13 und mit IE 8 nur in der Kompatiblitätsansicht...

    CSS 2.1 spec http://www.w3.org/TR/CSS2/colors.html

    "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').

    Note that there is only one viewport per view. If an element has a scrolling mechanism (see 'overflow'), a 'fixed' background does not move with the element, and a 'scroll' background does not move with the scrolling mechanism."

    Die Fomulierung lässt keinen Raum für: and a scroll background does move within the scrolling mechanism.

    Grund: There is only one viewport per view.

    An anderer Stelle: http://www.w3.org/TR/CSS2/visuren.html#viewport
    "When the viewport is smaller than the area of the canvas on which the document is rendered, the user agent should offer a scrolling mechanism. There is at most one viewport per canvas, but user agents may render to more than one canvas (i.e., provide different views of the same document). "

    Da ist also nur ein screen canvas und ein print canvas, ergo nur ein viewport.

    mfg Beat

    --
    ><o(((°>           ><o(((°>
       <°)))o><                     ><o(((°>o
    Der Valigator leibt diese Fische
    1. Auch wenn ich gestehen muss, nicht alles verstanden zu haben, heist das wohl, dass die Tatsache, dass es mit dem Kompatiblitätsmodus des IE8 klappt, ein Bug ist?!?!

  2. Hi,

    Wie man an dem overflow:scroll schon erkennen kann, soll der Container bei übergroßem Inhalt scrollbar sein, was auch wunderbar funktioniert. Leider bis auf die Tatsache, dass das background-image (es ist ein blauer Balken an der Oberseite des <div>) nicht mitscrollt.

    Natürlich, der Container selbst scrollt ja auch nicht, sondern nur sein Inhalt - also bleibt sein Hintergrund mit ihm "stehen".

    Damit sollte die Lösung/der Workaround ja auch auf der Hand liegen, oder?

    MfG ChrisB

    --
    Light travels faster than sound - that's why most people appear bright until you hear them speak.