How to style only the first item in a list


 To achieve this we have to deploy the child selector like so.

<ul>
  <li>red </li>
  <li>blue </li>
  <li>green</li>
</ul>

CSS: 

<style>
 li:first-child{color: red;}
</style>

Comments

Check out

CSS Sprites | What are They?

Login form | Using CSS3

Remove Scrollbars from syntaxhighlighter

Adding a button in HTML | styling a button

HTML5 Semantic Tags | What do they mean

How to remove plus and minus characters from input type number

HTML5 | LocalStorage

jQuery Resources | Support and tutorial help

How CSS3 Works