How to target only Firefox with CSS?

Spread the love

To target only Firefox with CSS, we use @supports.

For instance, we write

@supports (-moz-appearance: none) {
  h1 {
    color: red;

to target Firefox with @supports (-moz-appearance: none).

And we set h1 elements to have color red when in Firefox only.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *