input[type=number]:not(#sun):nth-child(odd) { margin-right: 1px; } 

The exception works, but nth-child considers it. Is it possible to make nth-child skip this element? Preferably by means of css.

  • Rephrase the question. It is not clear what you need. The property applies to all odd elements except the element with #sun . Add your html - E_K
  • Add your html + - Rogatnev Nikita
  • It is difficult to understand without markup, but if I understood correctly, then each exception must be specified separately: input [type = number]: not (#sun): not (: nth-child (odd)) - Frigoris

0