Skip to content

Instantly share code, notes, and snippets.

@Potherca
Created June 12, 2013 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Potherca/5763424 to your computer and use it in GitHub Desktop.
Save Potherca/5763424 to your computer and use it in GitHub Desktop.
Simple demonstration how nth-child works
/* Simple demonstration how nth-child works */
span {
width: 5em;
border: 0.1em solid;
display: inline-block;
text-align: center;
}
span:nth-child(5n) {
display: none;
}
span:nth-child(3n) {
visibility: hidden;
}
<p>
<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>
<span>10</span>
<span>11</span>
<span>12</span>
<span>13</span>
<span>14</span>
<span>15</span>
</p>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment