Is there a way in CSS to style every second group of three elements? If so, how can this be achieved?
For example, in the code snippet below, how can we style the 4th-6th and 10th-12th li
elements?
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
</ul>
While JavaScript and jQuery can handle this task, is there a CSS-only solution available?