Below is my html structure
You read it wrong. It says that it's not supported in IE8:
If you were looking at :first-child
, which does have support in IE7 and IE8, and thinking that the same applies to :last-child
... surprise! It doesn't.
:first-child
is a CSS2 selector, but :last-child
was only introduced in CSS3, so since Microsoft was only aiming for CSS2.1 compliance with IE8, they likely didn't bother about :last-child
until post-IE8.
If you know you will only have four li
elements, then you should be able to use adjacent sibling selectors to reach the fourth li
:
.footerMenu li:first-child + li + li + li