nth-child-1.html (1457B)
1 <!DOCTYPE HTML> 2 <html><head> 3 <meta charset="utf-8"> 4 <title>Tests :nth-child(An+B) matching</title> 5 <style type="text/css"> 6 7 div :nth-child(+3n/**/-2) { background-color:black; } 8 div :nth-child(+3n/**/-2) { font-size:12px; } 9 div :nth-child(+3n-/**/2) { text-decoration: underline; } 10 div :nth-child(+3n-2/**/) { border-left-width: 1px; } 11 div :nth-child(+3n/**/-2) { border-top-width: 1px; } 12 div :nth-child(+3n/**/-2) { border-bottom-width: 1px; } 13 div :nth-child(+3n-/**/2) { border-right-width: 1px; } 14 div :nth-child(+3n-2/**/) { border-style: solid; border-color: blue;} 15 16 /* valid but will not match anything */ 17 div :nth-child(-n/**/-2) { color:red; } 18 div :nth-child(-n/**/-2) { color:red; } 19 div :nth-child(-n-/**/2) { color:red; } 20 div :nth-child(-n-2/**/) { color:red; } 21 div :nth-child(-1n/**/-2) { color:red; } 22 div :nth-child(-1n/**/-2) { color:red; } 23 div :nth-child(-1n-/**/2) { color:red; } 24 div :nth-child(-1n-2/**/) { color:red; } 25 26 /* invalid */ 27 div :nth-child(-/**/ n-2) { color:red; } 28 div :nth-child(- /**/n-2) { color:red; } 29 div :nth-child(+/**/ n-2) { color:red; } 30 div :nth-child(+ /**/n-2) { color:red; } 31 div :nth-child(+3/**/n-2) { color:red; } 32 div :nth-child(-/**/n-2) {color: red;} 33 34 </style> 35 </head> 36 <body> 37 38 <div><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x></div> 39 40 </body> 41 </html>