0

Possible Duplicate:
Are There Specific CSS Selectors Targeting IE10?

I have what I want working in IE8, IE9, Chrome, FF, Safari, and Opera. But for whatever reason I'm having issues with the negative margins I'm using are not working in ie 10, is there any way to JUST target IE 10?

Community
  • 1
  • 1

1 Answers1

1

Yes, but I'd be surprised if it is an IE10 bug – most likely it will be a mistake in what you have authored. Perhaps you are assuming a font that isn't installed, or haven't realised that there is a default margin on something you didn't expect.

IE10 doesn't support Conditional Comments any more ( http://blogs.msdn.com/b/ie/archive/2011/07/06/html5-parsing-in-ie10.aspx ), so that isn't an option (which is a good thing - markup should be the same everywhere).

The User Agent for IE10 is a variation on:

Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)

( http://blogs.msdn.com/b/ie/archive/2012/07/12/ie10-user-agent-string-update.aspx )

so, you could use PHP or whatever to detect that, then add a class to your html tag to use in your CSS.

But don't, unless you absolutely have to – if it doesn't work in IE10, what's to stop it breaking in Chrome 28, or Firefox 30?

Rich Bradshaw
  • 71,795
  • 44
  • 182
  • 241
  • I'm curious if Chrome will be in its 50s or 60s by the time Firefox turns 30. – BoltClock Nov 03 '12 at 09:22
  • I've written a small, vanilla JavaScript plugin called Layout Engine, which allows you to feature detect IE 10 (and every other browser), in a simple way that cannot be faked, unlike user agent sniffing. It adds the rendering engine name as a class on the html tag and returns a JavaScript object containing the vendor and version (where appropriate) Check out my blog post: http://mattstow.com/layout-engine.html and get the code on GitHub: https://github.com/stowball/Layout-Engine – Matt Stow Feb 02 '13 at 03:26