Pseudo Elements :before and :after with CSS 2.1

Here is a quick example of how to use Pseudo elements “:before” and “:after” with css. li{ display:block; } li:before{ content:”This is red from :before”; color:red; } li:after{ content:”This is blue from after”; color:blue; } Click here for the demo page

Pseudo CSS first-child, last-child

In CSS 2.1 the “first-child” and CSS 3 adds “last-child” pseudo-class implementation. These allow for specific stlyes to be added to beginning and ending elements. This can be extremely helpful for navigation and other common list types. The one draw back of using these pseudo-classes is ie6 will not support them. Here is a short […]