Menu

gitpiper

Zebra striped list css Code Snippet in 2025

visualbeginner

Last Updated: 25 April 2025

Creates a striped list with alternating background colors.

  • Use the :nth-child(odd) or :nth-child(even) pseudo-class selectors to apply a different background-color to elements that match based on their position in a group of siblings.
  • Note: You can use it to apply different styles to other HTML elements like <div>, <tr>, <p>, <ol>, etc.
<ul> <li>Item 01</li> <li>Item 02</li> <li>Item 03</li> <li>Item 04</li> <li>Item 05</li> </ul>
li:nth-child(odd) { background-color: #999; }

css snippet similar to Zebra striped list For You in April 2025

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2025 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️