Hallo,
margin-top:-250px;
margin-left:-250px;
position:absolute;
left:50%;
top:50%;
Vielleicht kannst du mit zusätzlichen Containern und min-width
etc. noch
etwas erreichen.
Ansonsten wird margin-auto
gut genug von den Browsern unterstützt, um
horizontal auszurichten.
Also erstmal so etwas:
div.oc {
background-color:green;
width:500px;
height:500px;
margin:auto;
}
Oder für moderne Browser die Tabelle:
div.ta {
display: table;
height:100%;
width:500px;
margin:auto;
}
div.tc{
width:100%;
display: table-cell;
vertical-align: middle;
}
div.oc {
background-color:green;
width:500px;
height:500px;
}
~~~~~~html
</style>
</head>
<body>
<div class="ta">
<div class="tc">
<div class="oc">Hallo Welt
</div>
</div>
</div>
Grüsse aus Düsseldorf
Cyx23