Menu Close

How to target only Firefox with CSS?

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.

Posted in CSS