css

CSS Equivalent of the "if" statement


Is there any way to use conditional statements in CSS?


Solution

  • No. But can you give an example what you have in mind? What condition do you want to check?

    Maybe Sass or Compass are interesting for you.

    Quote from Sass:

    Sass makes CSS fun again. Sass is CSS, plus nested rules, variables, mixins, and more, all in a concise, readable syntax.