<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Elements3</title> </head> <body> <ul> <li>Hello, This is first element</li> <li>Whidy! so many elements</li> <li>Whidy! so many elements</li> <li>Whidy! so many elements</li> <li>Here it is, The last element</li> </ul> </body> </html>
ul { border: 1px solid #000; margin: 0; padding: 0; list-style: none; float:left; } ul li { background:#eee; color: #F00; margin: 50px; } ul li:nth-child(2n) { color: #000; margin-top: 0 !important; margin-left: 0 !important; }