rlab
rlab

Reputation: 449

Absolute positioning not displaying correctly in Chrome

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.

Upvotes: 0

Views: 261

Answers (1)

Luis Perez
Luis Perez

Reputation: 28130

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

Upvotes: 1

Related Questions