Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Titre du document</title> <style> p:nth-last-child(odd) { background: #1c87c9; color:#eee; } p:nth-last-child(even) { background: #666; color:#eee; } </style> </head> <body> <h2>Exemple du sélecteur :nth-last-child</h2> <p>Paragraphe 1</p> <p>Paragraphe 2</p> <p>Paragraphe 3</p> </body> </html>