0

Is it possible to have only one CSS property different in Chrome in comparison to Firefox?

A certain element has absolute positioning and is displaying correctly in Firefox but in Chrome it appears 2 pixels lower.

rlab
  • 449
  • 1
  • 7
  • 24

1 Answers1

1

To target just Firefox use this:

<style type="text/css">
@-moz-document url-prefix() {
    h1 {
        color: red;
    }
}
</style>

<h1>This should be red in FF</h1>

I got this answer from another stack overflow question: Targeting only Firefox with CSS

You can test this by opening the following jsFiddle in both browsers: jsFiddle

Community
  • 1
  • 1
Luis Perez
  • 27,650
  • 10
  • 79
  • 80