user13
user13

Reputation: 85

Why is :target pseudo class not working in IE?

I am making use of :target pseudo class but however it is not working in IE browser (7 and 8).

I used selectivizr javascript but its still not working.

So is there any other way to make it work? Is it possible by means of jQuery?

Upvotes: 1

Views: 884

Answers (4)

jibiel
jibiel

Reputation: 8313

Just tried Selectivizr — worked for me in IE8! Not in IE7 though. Give edge release a try:

<!--[if (gte IE 6)&(lte IE 8)]>
  <script type="text/javascript" src="https://raw.github.com/keithclark/selectivizr/master/selectivizr.js"></script>
  <noscript><link rel="stylesheet" href="[fallback css]" /></noscript>
<![endif]-->

Upvotes: 0

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324750

When using jQuery, instead of :target, you can just use $(location.hash) and, if it exists, that will be your :target element.

Upvotes: 1

VaclavD
VaclavD

Reputation: 2632

I think even Modernizr will not help you. The :target pseudo class is hard to detect by a workaround.

Upvotes: 0

Arun P Johny
Arun P Johny

Reputation: 388406

The :target pseudo class is supported only in IE9. Refer here

Upvotes: 5

Related Questions