.test { [COLOR=silver]<-- name der css[/COLOR]
background-attachment: fixed; [COLOR=silver]<-- nicht wiederholen/kacheln[/COLOR]
background-image: url(xxx.png); [COLOR=silver]<-- BG Bield[/COLOR]
background-repeat: no-repeat; [COLOR=silver]<-- scrollt nicht mit[/COLOR]
//background-position: 100% 100%; [COLOR=silver]<-- strecken auf 100% (würd ich nicht tun)[/COLOR]
background-position: center center; [COLOR=silver]<-- mitte [/COLOR]
background-color: #000000; [COLOR=silver]<-- bg farbe[/COLOR]
left: 50px; [COLOR=silver]<-- abstand links[/COLOR]
top: 50px; [COLOR=silver]<-- abstand oben[/COLOR]
}
<body bgcolor="#xxxxxx" background="images.jpg" text="#xxxxxx" link="#xxxxxx" vlink="#xxxxxx" alink="#xxxxxx"
leftmargin="50" topmargin="50" bgproperties="fixed" style="Background-Image: images.jpg); Background-Repeat: no-repeat;
background-position:center; background-position:top;">
<html>
<head>
</head>
<body bgcolor="#DDDDDD" text="red" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>
<img src="Pfad/zum/Hintergrundbild.jpg" height=100% width=100%>
<div style="position:absolute; left:0; top:0">
<!-- hier kommt der eigentliche Inhalt hin!
Und schon habt Ihr ein gestrecktes Hintergrundbild!
Wichtig ist das der Text zwichen den Div-Tag's steht!//-->
</div>
</body>
</html>
<div style="position:fixed;top:0;left:0;z-index:0;">
<img src="Pfad/zum/Hintergrundbild.jpg" height="100%" width="100%">
</div>
<div style="position:absolute;top:0;left:0;z-index:3;">Hier der Inhalt</div>
Das macht das Hintergrundbild nur so hoch und breit wie der Vieport ist und fixiert es nicht. Sobald der Inhalt im DIV so lang wird, dass er nicht mehr auf einen Bildschirm passt, und man scrollen muss, scrollt das Hintergrundbild mit.
wenn man das ein klein wenig ändert, sollte das aber dennoch hin zu bekommen sein:
HTML:<div style="position:fixed;top:0;left:0;z-index:0;"> <img src="Pfad/zum/Hintergrundbild.jpg" height="100%" width="100%"> </div> <div style="position:absolute;top:0;left:0;z-index:3;">Hier der Inhalt</div>
Oder alternativ ein post weiter oben + fest definierter Höhe und Breite für das DIV sowie overflow:scroll ...
Oder alternativ mit Hilfe von ein paar Zeilen JavaScript, da der IE manchmal Probleme mit position:fixed hat.
Wieso? In dem Div kann man doch alle Elemente so ausrichten wie man Spaß daran hat...