HTML CSS examples for CSS Widget:UL Element
Styling ul tags. Numbered lists
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!-- w ww. j a va 2 s. co m--> counter-reset:listCounter; } ul { list-style:none; } ul>li:nth-child(odd):before { content:counter(listCounter)': '; } ul>li:nth-child(even):before { content:'A: '; } li { margin:21px 0; } li:nth-child(odd) { counter-increment:listCounter; } </style> </head> <body> <ul> <li>Lorem ip</li> <li>Lorem </li> <li>Lorem ip</li> <li>Lorem </li> <li>Lorem ip</li> <li>Lorem </li> <ul> </ul> </ul> </body> </html>