HTML CSS examples for CSS Widget:UL Horizontal
Center list-elements horizontally independent of amount of elements
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ul {<!-- www .ja va 2 s .co m--> width:100%; background-color:Chartreuse; text-align:center; } li { list-style:none; display:inline-block; padding:2em; } </style> </head> <body> <ul> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> </ul> <ul> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> <li>Lorem </li> </ul> </body> </html>