uwe: Drei Blockelemente zentrieren

Beitrag lesen

Primus

Scheiß Brauser1!!!

Versuchs mal hiermit, dann klappts auch in deinem sogenannten sch... Browser.

<html>
<head>
<title>CSS - centering</title>

<style>
<!--

html,body {
 margin: 0;
 padding: 0;
}

table {
 width: 100%;
 height: 100%;
}

td {
 vertical-align: middle;
 text-align: center;
}

div {
 border: 1px solid #000000;
}

div.container {
 position: relative;
 text-align: left;
 margin-left: auto;
 margin-right: auto;
 width: 780px;
 height: 432px;
}

div.left {
 position: absolute;
 top: 0px;
 left: 0px;
 width: 200px;
 height: 432px;
}

div.top {
 position: absolute;
 top: 0px;
 left: 200px;
 width: 580px;
 height: 150px;
}

div.main {
 position: absolute;
 top: 150px;
 left: 200px;
 width: 580px;
 height: 282px;
}

-->
</style>
</head>

<body>

<table border=0>
 <tr>
  <td>
   <div class="container">
    <div class="left">
     Left content
    </div>
    <div class="top">
     Top content
    </div>
    <div class="main">
     Main content
    </div>
   </div>
  </td>
 </tr>
</table>

</body>
</html>

Cheers
Uwe
Portland, Oregon