The easiest way to achieve this is to mark your first and last items with custom classes and remove these fields from them.
<ul class="menu"> <li class="first">One</li> <li>Two</li> <li>Three</li> <li class="last">Four</li> </ul> <style> .menu li { margin: 0 1px; } .menu .first { margin-left: 0; } .menu .last { margin-right: 0; } </style>
You can also try using complex css selectors, for example :first-child , but they do not work in older versions of MSIE.
OR, you can use the 2px fields on the right side and go with only one additional class:
<ul class="menu"> <li>One</li> <li>Two</li> <li>Three</li> <li class="last">Four</li> </ul> <style> .menu li { margin-right: 2px; } .menu .last { margin-right: 0; } </style>
n1313 source share