---
title: "HILFE - Seite im Broweser zentrieren"
url: "https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren"
source: "typo3.net"
tags: ["Frontend","Styling","Frage","HTML & CSS","TYPO3 4"]
created: "2013-04-22"
last_reply: "2013-04-23"
replies: 6
solved: false
page: 1
pages: 1
lang: "de"
---

# HILFE - Seite im Broweser zentrieren

Frontend › Styling · 6 Antworten · gestartet 2013-04-22

## Eröffnungsbeitrag

**DonKB** · 2013-04-22 · [Beitrag #1](https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren/1)

Liebe Typo3-Gemeinde,

bin relativ unerfahren mit Typo3 (Version 4.2.9) und soll nun für meinen Chef eine bestehende Website "modernisieren". Unsere Seite wird in den Browsern linksbündig dargestellt, doch ich will sie zentriert haben.

Meine Frage: Mit welchen Befehlen bekomm ich die Seite zentriert.

Hier css:

```css
*/
html, body, div, span, h1, h2, h3, h4, p, hr, table, tr ,td, th, a, ul, li, form, select, input, submit, label {
  margin:0;
  padding:0;
  font-family:Verdana,Helvetica,Jamrul,sans-serif;
  color:#000000;
  font-size:11px;
}

p {
  padding-left:15px;
  padding-top:0px;
  padding-bottom:9px;
  padding-right:15px;
  line-height:15px;

}
h1 {
  padding-left:0px;
  padding-right:15px;
  padding-bottom:0px;
}


h2 {
  padding-left:15px;
  padding-right:15px;
  padding-bottom:5px;
  padding-top:20px;
  line-height:15px;
}
h3 {
  padding-left:15px;
  padding-right:15px;
  padding-bottom:5px;
  padding-top:20px;  
}

p.yellow {
  background-color:#f0e40a;
  height:147px;

}
p.yellow a {
  color:#000000;
}

p.green {
  background-color:#007770;
  color:#FFFFFF;
  height:147px;
}

p.green a {
  color:#FFFFFF;
}

p.brightgreen {
  background-color:#76bab2;
  height:147px;
}
p.brightgreen a {
  color:#000000;
}


img {
  margin:0;
  padding:0;
}

html, body, div, span, h1, h2, h3, p, hr, table, tr ,td, th, a {
  border:0;
}

* {
  margin:0;
  padding:0;
}

html, body {
  height: 100%;
  width: 100%;
}


a:hover {
  text-decoration:underline;
}
a {
  text-decoration:underline;
  color:#000000;
}




/* 
   =================================================================
     STRUKTUR 
   =================================================================
*/



#wrapper_content {
  position:absolute;
  top:40px;
  left:40px;
}

#content {
  float:left;
  width:950px;
}

#top {
  height:125px;
}

#logo {
  position:absolute;
  top:0px;
  left:0px;
}

#menu_main {
  position:absolute;
  top:60px;
  left:30px;
  width:100%;
  height:65px;;
}
#menu_main img {
 border:0px;
}
  

#menu_impressum {
  position:absolute;
  top:60px;
  left:740px;
  width:210px;
  height:65px;;
  text-align:right;
}
#menu_impressum img {
 border:0px;
}

#middle {
  position:absolute;
  left:15px;
  float:left;
  width:735px;
  min-height:200px;
}
```

Hier der html:

```html
<html>
	
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link rel="stylesheet" type="text/css" href="main.css" />
<head>

<body>
<!--###DOCUMENT###-->
<div id="wrapper_content">
	<div id="content">
		<div id="top">
			<div id="logo"><a href="index.php"><img src="fileadmin/layout/logo.gif" width="150" height="45" border="0" ></a></div>
			<div id="menu_main">###MAINMENU###<br>###SUBMENU###</div>
			<div id="menu_impressum">###IMPRESSUMMENU###</div>
		</div>
		<div id="middle">
			###CONTENT###
		</div>
	</div>
</div>
</div>
<!--###DOCUMENT###-->	
</body>
</html>
```

Bitte, bitte helft mir, da ich gerade voll auf dem Schlauch stehe und dringend ein Ergebnis brauche. Vielen Dank. DonKB

## Antworten

### [#2](https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren/2) · vince · 2013-04-22

Hallo,

das geht mit css, z.B. so:

```css
body{
  width : 1000 px; /* oder irgendein andere Wert */
  margin : auto;
}
```

Gruß,
Vince.

### [#3](https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren/3) · DonKB · 2013-04-22

Hallo Vince,

danke für deinen Vorschlag. Hab ich gleich mal ausprobiert, doch leider tut sich da nix, wenn ich den neuen Code in css einbaue.

Hat vielleicht noch jemand eine Idee?

Viele Grüße,
DonKB

### [#4](https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren/4) · vince · 2013-04-22

ich hab mir Dein css mal näher angeschaut:

1) die css-Eingenschaften (margin und width) werden an anderer Stelle wieder überschrieben, z.B. hier

```css
html, body, div, span, h1, h2, h3, h4, p, hr, table, tr ,td, th, a, ul, li, form, select, input, submit, label {
  margin:0; /* dadurch wird margin:auto nicht übernommen */
  padding:0;
  font-family:Verdana,Helvetica,Jamrul,sans-serif;
  color:#000000;
  font-size:11px;
}
```

bzw. hier:

```css
html, body {
  height: 100%;
  width: 100%;
}
```

2) Viele der div-Container haben die Eigenschaft position:absolute, dadurch werden sie nicht relativ zur Position des bodys gesetzt.

### [#5](https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren/5) · mah · 2013-04-22

Im Endeffekt würde ich das niemals über Body lösen :) Wofür hast du das div mit der id wrapper-content?
Genau um den Inhalt deiner Seite zum umschließen ;)
Also passt du einfach das CSS für diesen Container an.
#wrapper_content {
  position:relative;
  margin: 0 auto;
  width: 950px;
}

Allerdings würde ich dir empfehlen dich damit mehr auseinander zu setzten, da der Rest deines CSS-Codes auch nicht wirklich "gut" ist. Wozu zum Beispiel floatet der Container #middle?

<http://www.w3schools.com/> <-- Da gibt es einige Toturials

### [#6](https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren/6) · etux · 2013-04-22

Wenn Du die Frage in mehreren Foren postest, solltest Du zumindest darauf hinweisen (Link)
<http://www.typo3forum.net/forum/typo3-4-x-fragen-probleme/60353-hilfe-seite-zentrieren.html>

### [#7](https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren/7) · DonKB · 2013-04-23

Liebe Typo3-Freunde,

ich muss mich bei allen von euch herzlich bedanken.
Es hat geklappt und ich habe es über #wrapper_content endlich geschafft die Seite zu zentrieren.
Bestimmt lässt die nächste Frage nicht lange auf sich warten ...
Vielen, vielen Dank.

Gruss, DonKB :D

---

Quelle: „HILFE - Seite im Broweser zentrieren“, typo3.net, https://www.typo3.net/d/114629-hilfe-seite-im-broweser-zentrieren
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
