Reputation: 121
CSS : last-child is not working in IE8 browser any alternate solution for this tag.
I tried with :last-of-type, but also it is not working.
Can any one help me on this ?
Thanks Jagadeesh.N
Upvotes: 0
Views: 295
Reputation: 799
You can always load a polyfill for that:
<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="selectivizr.js"></script>
<![endif]-->
Here's the link: http://selectivizr.com/
Upvotes: 0
Reputation: 85545
:first-child
is only supported in IE8 but sorry to say that :last-child
isn't supported for IE8.
To be easy just define the class name for that div and apply the css
Solution with jQuery:
$('*').last().addClass('last-child');
Or,
$('*:last-child').addClass('last-child');/*use it with care*/
So now you can simply use div.last-child
as a selector in your stylesheet.
Upvotes: 1
Reputation: 668
IE8 does not support :last-child
So, you can use this method:
Your best bet is to explicitly add a last-child (or similar) class to that item, and apply li.last-child instead.
Upvotes: 0