Can you use if/else conditions in CSS?
Not in the traditional sense, but you can use classes for this, if you have access to the HTML. Consider this: and in your CSS file: That’s the CSS way to do it. Then there are CSS preprocessors like Sass. You can use conditionals there, which’d look like this: Disadvantages are, that you’re bound to pre-process your stylesheets, and that … Read more