Can you help me center a <ul> element with CSS?
To center a row of blocks, you should use inline-block:
ul.menu { display: block; text-align:center; }
ul.menu li { display: inline-block; }
IE doesn't understand inline-block, but if you set it inline just for IE, it'll still behave as an inline-block:
<!--[if lt IE 8]>
ul.menu li { display: inline }
<![endif]-->
1 Write style="text-align: center;"
to parent div
of ul
2 Write style="display: inline-table;"
to ul
2 Write style=" display: inline;"
to li
<div class="menu">
<ul>
<li>menu 1</li>
<li>menu 2</li>
<li>menu 3</li>
</ul>
</div>
<style>
.menu { text-align:center; }
.menu ul { display:inline-table;}
.menu ul li {display:inline;}
</style>
Finish