Ever wondered how to center a ul with css in a html page ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<HTML> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="center"> <ul> <li>HTML</li> <li>CSS</li> <li>JAVASCRIPT</li> </ul> </div> </body> </html> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
ul li { display: inline; } li { color: black; font-weight: bold; font-size: 30px; } #center { text-align: center; } |
And the result