Background geht nicht über dem gesamten Body

Hallo,

brauche bitte eure Hilfe. Ich bin gerade dabei eine Homepage zu gestalten. Habe leider einige Probleme. Dem body habe ich eine Hintergrundfarbe gegeben, die sich leider nicht über dem gesamten Hintergrund verteilt, sondern nur in der Höhe des headers. Auch die einzelnen div-container „harmonieren“ nicht richtig miteinander. Wäre schön wenn mir einer helfen könnte.

Vielen Dank

Tophy 75

Hier die html -und csscodes:

<div id="footer"

Diese Internetseite ist urheberrechtlich geschützt. ©Copyright: 2012

@charset „UTF-8“;

  • {margin: 0px; padding: 0px; }

body{

background: #bc0101; /* Old browsers /
background: -moz-linear-gradient(top, #bc0101 0%, #fcece3 100%, #ea5507 100%, #fb955e 100%); /
FF3.6+ /
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bc0101), color-stop(100%,#fcece3), color-stop(100%,#ea5507), color-stop(100%,#fb955e)); /
Chrome,Safari4+ /
background: -webkit-linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
Chrome10+,Safari5.1+ /
background: -o-linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
Opera 11.10+ /
background: -ms-linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
IE10+ /
background: linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
W3C /
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‚#bc0101‘, endColorstr=‚#fb955e‘,GradientType=0 ); /
IE6-9 */
margin: 0 auto;
min-width: 980px;
max-width: 1210px;

}

/Design/

#header{

     width: 910px;
    height:200px;
    top: 30px;    
    left: 150px;
    background: url(Header.png);
    position: relative;
           
            }

/* Navigation Layout-Aufklappfunktion (ohne Styling) */

#navigation ul{ margin: 0 0 20px 0; padding: 0px; }
#navigation ul li{ display: inline;position:relative; }
#navigation ul ul,#navigation ul ul { display: none; }
#navigation ul ul li, #navigation ul ul li {display: block; }
#navigation ul li:hover> ul {display: block; position: absolute; left: 0px; }
#navigation ul li:hover> ul {top: 100%; }
#navigation ul ul li:hover ul {left: 100%; top:0px; }

/* Styling Klapp-Menü */

#navigation > ul { padding: 20px 70px 30px;
margin:-6px;
background: url(Navigationsbar.png) no-repeat;
}

#navigation a {
color:#D20014; text-decoration: none;}

#navigation ul li{ background: url (Leiste.png) repeat-x;
font-weight: bold;
padding: 15px;
}

#navigation ul li:hover a { text-decoration:none;
color: white;
}

#navigation ul ul li{
background: url(Leiste.png) repeat-x; padding: 7px 10px;
}
/Text Home/

#Hauptbild {
top: 260px;
left: 150px;
width: 910px;
height:919px;
position:absolute;
background:url(KB-Web-Datei-WW–fond-hellgrau-web.png);
top center no-repeat;
font-family:„Trebuchet MS“,„Sergio UI“,„tahoma“,„Verdana“;
}

#footer {

background: #b5bdc8; /* Old browsers /
background: -moz-linear-gradient(top, #b5bdc8 0%, #828c95 100%, #28343b 100%); /
FF3.6+ /
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b5bdc8), color-stop(100%,#828c95), color-stop(100%,#28343b)); /
Chrome,Safari4+ /
background: -webkit-linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
Chrome10+,Safari5.1+ /
background: -o-linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
Opera 11.10+ /
background: -ms-linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
IE10+ /
background: linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
W3C /
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‚#b5bdc8‘, endColorstr=‚#28343b‘,GradientType=0 ); /
IE6-9 */
background-position: center bottom;
background-repeat: repeat-x;
font-family:„Trebuchet MS“,„Sergio UI“,„tahoma“,„Verdana“;
height: 10px;
width: 730px;
font-size:1em;
padding: 15px 25px 30px 157px;
color:white;
}

Hey tophy75,
bitte benutze doch die code-tags des Forums. :slight_smile:

Die HTML-Datei ist leider nicht komplett angegeben, darf ich die mal sehen? So wie sie da steht ist sie auf jeden Fall nicht korrekt und das dürfte dann schon sehr wahrscheinlich der Fehler sein. Da geht ein div (#hauptbild) auf und nicht wieder zu.

Gruß
Körnerbrötchen

Da fehlen schon mal
[HTML]

[/HTML]

am Anfang des Codes.

Du positionierst wichtige Elemente der Webseite absolut. Dadurch erhält der body auch nicht die von dir gewünschte Höhe. Verzichte auf absolute Positionierung, dann klappt es.

@threadi,

das war ein heißer Tipp, vielen Dank. Aber warum ist das so?

tophy75

Ich hätte gerne noch eine Frage: den Header habe ich jetzt positioniert. Wenn ich das NAviagtionsmenü die selben left-position gebe wie den Header dann steht es aber trotzdem weiter links als der Header, dass selbe gilt für den footer und Hauptbild, die beiden Container „kleben“ aneinander. Warum ist das so?

Danke

Siehe Grundlagen Positionierung:
position: Positionsart: CSS-Referenz auf CSS 4 You - The Finest in Stylesheets
CSS Positioning

Kann ich ohne deinen aktuellen Quellcode nicht beurteilen. Besser wäre ein Link zur Seite selbst.

Einen Link zur seite gibt es noch nicht. Hier die Codes:

<div id="footer"

Diese Internetseite ist urheberrechtlich geschützt. ©Copyright: 2012

@charset „UTF-8“;

  • {margin: 0px; padding: 0px; }

/Verläufe/
body{

background: #bc0101; /* Old browsers /
background: -moz-linear-gradient(top, #bc0101 0%, #fcece3 100%, #ea5507 100%, #fb955e 100%); /
FF3.6+ /
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bc0101), color-stop(100%,#fcece3), color-stop(100%,#ea5507), color-stop(100%,#fb955e)); /
Chrome,Safari4+ /
background: -webkit-linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
Chrome10+,Safari5.1+ /
background: -o-linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
Opera 11.10+ /
background: -ms-linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
IE10+ /
background: linear-gradient(top, #bc0101 0%,#fcece3 100%,#ea5507 100%,#fb955e 100%); /
W3C /
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‚#bc0101‘, endColorstr=‚#fb955e‘,GradientType=0 ); /
IE6-9 */
margin: 0 auto;
min-width: 980px;
max-width: 1210px;

}

/Design/

#header{

     width: 910px;
    height:200px;
    top: 30px;    
    left: 150px;
    background: url(Header.png);
    position: relative;
           
            }

/* Navigation Layout-Aufklappfunktion (ohne Styling) */

#navigation ul{ margin: 0 0 20px 0; padding: 0px; }
#navigation ul li{ display: inline;position:relative; }
#navigation ul ul,#navigation ul ul { display: none; }
#navigation ul ul li, #navigation ul ul li {display: block; }
#navigation ul li:hover> ul {display: block; position: absolute; left: 0px; }
#navigation ul li:hover> ul {top: 100%; }
#navigation ul ul li:hover ul {left: 100%; top:0px; }

/* Styling Klapp-Menü */

#navigation > ul { padding: 20px 70px 30px;
margin:-6px;
background: url(Navigationsbar.png) no-repeat;
}

#navigation a {
color:#D20014; text-decoration: none;}

#navigation ul li{ background: url (Leiste.png) repeat-x;
font-weight: bold;
padding: 15px;
}

#navigation ul li:hover a { text-decoration:none;
color: white;
}

#navigation ul ul li{
background: url(Leiste.png) repeat-x; padding: 7px 10px;
}
/Text Home/

#Hauptbild {
top: 260px;
left: 150px;
width: 910px;
height:919px;
background:url(KB-Web-Datei-WW–fond-hellgrau-web.png);
top center no-repeat;
font-family:„Trebuchet MS“,„Sergio UI“,„tahoma“,„Verdana“;
}

/footer/

#footer {

background: #b5bdc8; /* Old browsers /
background: -moz-linear-gradient(top, #b5bdc8 0%, #828c95 100%, #28343b 100%); /
FF3.6+ /
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b5bdc8), color-stop(100%,#828c95), color-stop(100%,#28343b)); /
Chrome,Safari4+ /
background: -webkit-linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
Chrome10+,Safari5.1+ /
background: -o-linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
Opera 11.10+ /
background: -ms-linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
IE10+ /
background: linear-gradient(top, #b5bdc8 0%,#828c95 100%,#28343b 100%); /
W3C /
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‚#b5bdc8‘, endColorstr=‚#28343b‘,GradientType=0 ); /
IE6-9 */
background-position: center bottom;
background-repeat: repeat-x;
font-family:„Trebuchet MS“,„Sergio UI“,„tahoma“,„Verdana“;
height: 10px;
width: 730px;
font-size:1em;
padding: 15px 25px 30px 157px;
color:white;
top: 1300px;
left: 150px;
}

Der Footer „löst“ sich nicht vom Hauptbild. Vielleicht könnte mir da noch einer bitte helfen.

Was meinst Du mit „löst sich nicht vom Hauptbild“? Das kann man ohne die Bilder zu sehen nicht mal erahnen auf Basis dieses Quellcodes. Eine Demo-Seite (muss ja nicht mit den echten Bildern sein) kannst Du doch bereitstellen?

Unabhängig davon noch einige Hinweise zum Code.
Poste diesen bitte künftig in Code-Tags, das macht das lesen einfacher und übersichtlicher.
Hier hast Du einen Fehler eingebaut:

background:url(KB-Web-Datei-WW--fond-hellgrau-web.png); top center no-repeat;

Das müsste eigentlich

background:url(KB-Web-Datei-WW--fond-hellgrau-web.png) top center no-repeat;

lauten.

Hier

[html] <div id=„footer“

Diese Internetseite ist urheberrechtlich geschützt. ©Copyright: 2012

[/html]

fehlt ein „>“ - das solltest Du dank dem Highlighting über die Code-Tags hier sehen.

@threadi, besten Dank für die Hilfe, hatte einen Denkfehler. Habe gute Fortschritte gemacht. Eine Frage habe ich noch:Ich habe für meine Naviagtionsleiste einen Background erstellt, leider bekomme ich den nicht positioniert.

#navigation > ul { background: url(Navigationsbar.png) no-repeat ;position: relativ; top:30px; left: 38px ;
padding: 20px 30px 30px;
margin: 20px 195px;
width: 900px;
height:0px;
}

Woran kann das liegen?

Vielen Dank!

Da fehlt ein e bei relative. Was willst du denn positionieren? Den Background oder die Navigation? Hintergründe positioniert man anders: SELFHTML: Navigationshilfen / Kurzreferenz: CSS

Abgesehen von dem o.g. Tippfehler würde ich auch hinterfragen was es für einen Sinn macht ein Element relativ zu positionieren und auch noch margins anzugeben. Ich würde nur eines davon verwenden, vorzugsweise nur margin.