CSS Float mittig (center) ausrichten

Hier ein kleiner HTML & CSS Snippet um floatende Elemente mittig auszurichten.

/* CSS */
.container {margin:10px auto;width:960px;overflow:hidden}
.container-inner {position:relative;left:-50%;float:right}
.container-inner ul {position:relative;left:50%}
.container-inner li {display:inline;border-right:1px solid #525252;line-height:normal;padding:0 10px}
.container-inner a,.container-inner a:visited {color:#525252;text-decoration:none}
.container-inner a:hover {text-decoration:underline}
.container-inner li:last-child {border-right:none}

/* HTML */
<div class="container">
	<div class="container-inner">
		<ul>
			<li><a href="#" title="">float left</a></li>
			<li><a href="#" title="">float left</a></li>
			<li><a href="#" title="">float left</a></li>
		</ul>
	</div>
</div>

Keine Kommentare vorhanden

Hinterlassen Sie eine Antwort

Kontakt
Do NOT follow this link or you will be banned from the site!