Skip to content

Instantly share code, notes, and snippets.

@bradmontgomery
Created August 23, 2011 03:33
Show Gist options
  • Save bradmontgomery/1164283 to your computer and use it in GitHub Desktop.
Save bradmontgomery/1164283 to your computer and use it in GitHub Desktop.
Trying out nth-child(3n)
<html>
<head><title>nth child</title>
<style type="text/css">
ol.items { color: red; padding: 20px; border: 1px solid red; clear: both; margin: 20px; min-height: 110px; width: 490px;}
ol.items li { display: block; padding: 5px; margin: 5px; border: 1px solid #aaa; float: left; width: 100px; }
li:nth-child(3n) { color: orange; background-color: yellow; }
</style>
</head>
<body>
<ol class="items">
<li>one</li>
<li>two</li>
<li>three</li>
<li>four</li>
<li>five</li>
<li>six</li>
<li>seven</li>
<li>eight</li>
<li>nine</li>
<li>ten</li>
</ol>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment