Zum Inhalt springen

div an Inhalt anpassen

Erstellt am 9. Februar 2011 · 2 Antworten · letzte Antwort am 9. Februar 2011

Tags: HTML & CSS, Frage

xenith ·

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.

<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

#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?