dgivoni
dgivoni

Reputation: 555

IE9 CSS hack for background-position?

I need an IE9 CSS hack to be able to set the background-position property differently for IE9.

I have tried with several different ones that didn't work and from what I read somewhere, the background property is not possible to "hack" at least the same way as the other.

I basically need this to only apply to IE9:

#ABB_ABContent .subnav li.selected { background-position: center 17px; }

Any suggestions?

Upvotes: 3

Views: 3921

Answers (2)

Spudley
Spudley

Reputation: 168685

If you can't find anything else, there's always conditional comments:

<!--[if IE 9]>
IE9-specific code goes here
<![endif]-->

This would have to live in your HTML code, rather than your stylesheet, but you could use it to include an additional CSS file for IE9.

Alternatively, you may want to look up the Modernizr library. This is a small Javascript tool which you add to your site, which detects what features your browser supports, and allows you to write your CSS to target specific features (or their absence). If there's something about IE9 that it doesn't support which you're trying to work around, this may be the best solution.

I'm still puzzled as to what problem you're trying to solve though.

Upvotes: 2

huMpty duMpty
huMpty duMpty

Reputation: 14460

 <!--[if IE 9]>
      <link rel="stylesheet" type="text/css" href="your path" />
 <![endif]-->

Upvotes: 0

Related Questions