<!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>Elements</title> </head> <body> <ul> <li class="first">Hello, This is first element</li> <li>WOW, so many elements</li> <li>WOW, so many elements</li> <li>WOW, so many elements</li> <li class="last">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; } .first { color: #000; margin-top: 0 !important; margin-left: 0 !important; } .last { color: #0f0; margin-bottom: 0 !important; margin-right: 0 !important; }