• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Warum ist die Seite nicht zentriert?

FairlySkill

Neues Mitglied
Komme einfach nicht weiter erbitte Eure Hilfe!!!
Liebe Grüße

html,
body
{
width: 800px;
margin: 0 auto;
background-image : url(http://gartenbau-brandt.net/bilder/000.gif);
background-repeat : repeat;
}
body
{
font-family: Verdana sans-serif;
font-size: 12px;
font-weight: normal;
text-decoration: none;
color: #FFFFFF;
text-align:center;
}

.bild1
{ position:fixed; top:0px; width:800px; height:200px;
}
.menue
{ position:fixed; top:205px;
}

.link
{
background-color: #008000;
}

.text
{
position:fixed; top:205px; width:585px
}
.text
{
margin: 0px;
margin-left: 215px;
}
.text
{
background-color: #008000;
}
 
width: 800px;
margin: 0 auto;

wird auch html zugewiesen, dadurch entspricht die Größe von body der von html, und body kann nicht zentriert werden. html kann sich an keinem übergeordneten Element orientieren, und damit auch nicht zentriert werden.


mavhs am besten so:
Code:
body
{
  width: 800px;
  margin: 0 auto;
  background-image : url([URL]http://gartenbau-brandt.net/bilder/000.gif);[/URL]
  background-repeat : repeat;
  font-family: Verdana sans-serif;
  font-size: 12px;
  font-weight: normal;
  text-decoration: none;
  color: #FFFFFF;
  text-align:center;
}
 
"text-align: center;" ist an der Stelle aber unnötig, es sei denn man hat keinen Doctype und möchte die Seite im IE zentrieren ..

Besser so:
Code:
body
{
width: 800px;
margin: 0 auto;
background-image : url([URL="http://gartenbau-brandt.net/bilder/000.gif%29;"]http://gartenbau-brandt.net/bilder/000.gif);[/URL]
font-family: Verdana sans-serif;
font-size: 12px;
font-weight: normal;
color: #fff;
}
 
Zurück
Oben