HTML CSS examples for CSS Widget:UL Horizontal
Horizontally centering li inside ul
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ul.nav {<!-- ww w .ja v a 2s .c o m--> width:801px; margin:0 auto; list-style-type:none; text-align:center; padding-left:0; } .nav li { display:inline-block; width:301px; border:2px solid Chartreuse; } </style> </head> <body> <ul class="nav"> <li>Lorem ipsum d</li> <li>Lorem ipsum dolor</li> <li>Lorem ipsum dol</li> <li>Lorem ipsum dolo</li> </ul> </body> </html>