TYPO3-Testaccount
Testen Sie die aktuellste TYPO3-Version kostenlos und unverbindlich für einen Monat!

Jetzt testen!

Schulungen

jetzt buchen

div an Inhalt anpassen


Autor Nachricht
Verfasst am: 09. 02. 2011 [12:40]
xenith
Themenersteller
Dabei seit: 21.08.2008
Beiträge: 7
Hallo

Das DIV, welches bei mir den Inhalt umschliesst, passt sich nicht an die Grösse vom Inhalt an.

Mein html Template sieht so aus.

HTML
<body>
<!-- ###DOCUMENT_BODY### begin -->
<div id="container">
  <div id="header">###header###</div>
  <div id="img"><img src="fileadmin/templates/tmpl/images/bgleft.png" /></div>
  <div id="menu">###menu###</div>
  <div id="submenu">
    <div class="suche">###suche###</div>
    <div class="submenu">###submenu###</div>
  </div>
  <div id="content">###content###</div>
  </div>
  <div id="notruf">###notruf###<div id="nav_top">###nav_top###</div></div>
<div id="footer">###footer###</div>
<!-- ###DOCUMENT_BODY### end -->
</body>


Und hier das CSS File

CSS
#container{
  position:absolute;
  background-color:#ffffff;
  width:780px;
  margin-top: 20px;
  margin-left: 20%;
  margin-right: 20%;
  border:1px solid #2a8c2a;
}
 
#container[id]{
  width:758px;
}
 
html:root #container{
  width:759px;
}
 
#content{
  position:absolute;
  top:130px;
  left:160px;
  width:598px;
  padding:10px;
  padding-right:20px;
  padding-left:20px;
  color:#000000;
  text-align:justify;
    display:inline;
}
 
#content[id]{
  width:558px;
}
 
html:root #content{
  width:559px;
}


Hat jemand eine Idee was ich falsch mache?

Profil
Verfasst am: 09. 02. 2011 [12:45]
vixe
Dabei seit: 07.02.2007
Beiträge: 164
Hallo,

das position:absolute nimmt das Element aus dem normalen Elementfluss raus, d.h. der Platz wird dann nicht reserviert.

Gruß
Profil
Verfasst am: 09. 02. 2011 [15:24]
xenith
Themenersteller
Dabei seit: 21.08.2008
Beiträge: 7
Ja funktioniert jetzt. Vielen Dank für deine Hilfe.

Profil