html.de - Absolut positioniertes DIV zentrieren - horizontale Liste
by SpiceLab
HTML
<div class="so">
<div class="os">
<ul>
<li>t1</li>
<li>t2</li>
<li>t3</li>
<li>t4</li>
</ul>
</div>
</div>
CSS
* {
margin:0;
padding:0;
}
.so {
width:auto;
margin-top:23px;
left:50%;
position:absolute;
}
/* neu hinzugefĂĽgt */
.os {
background-color:aquamarine;
width:auto;
margin-top:23px;
left:-50%;
position:relative;
overflow:hidden;
}
ul {
list-style:none;
list-style-type:none;
}
ul li {
height:65px;
float:left;
padding-left:15px;
padding-right:15px;
background-color:deeppink;
margin-right:20px;
font-family:Arial,Helvetica, sans-serif;
line-height:65px;
color:yellow;
}
ul li:last-child {
margin-right:0;
}