p:first-child background: moccasin;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <title>:first-child</title> <style type='text/css'> body { font-size: 12px sans-serif; } p { padding: 3px; } p:first-child { background: moccasin; border: 1px solid tan; } </style> </head> <body> <p> The selector applies to this element, because it is the first child. </p> <p> It does not apply to this element, because it is not the first chld. </p> </body> </html>