我想居中個別菜單項目在這個水平CSS菜單中(從purecssmenu.com獲得)。居中水平菜單中的各個菜單項目
他們目前浮到左邊,我希望他們爲中心
<div class="wrapper">
<ul class="pureCssMenu pureCssMenum">
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Menu1</a></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>Menu2</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="pureCssMenum">
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Submenu1</a></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>Submenu2</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="pureCssMenum">
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Submenu3</a></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Submenu4</a></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Submenu5</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>Menu3</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="pureCssMenum">
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Submenu1</a></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Submenu2</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Menu4</a></li>
<li class="pureCssMenui"><a class="pureCssMenui" href="#">Menu5</a></li>
</ul>
</div>
完整的HTML標記和CSS可在此的jsfiddle http://jsfiddle.net/28X9v/
的解決方案應該是跨瀏覽器兼容,應至少在ie7/8中工作
您可以修復鏈接並添加jsfiddle。我會接受你的迴應。 – rogerb
只是想指出,@Nerranth的解決方案是建立在Era的建議之上的。多謝你們! – rogerb
我剛剛注意到,隨着您的更改,IE7將水平菜單渲染爲垂直菜單。有什麼建議麼?在IE8 +和Chrome中運行良好 – rogerb