I am wondering if there is some way to change a CSS attribute for the last li
in a list using CSS. I have looked into using :last-child
, but this
I usually do this by creating a htc file (ex. last-child.htc):
And call it from my IE conditional css file with:
ul { behavior: url("/javascripts/htc/last-child.htc"); }
Whereas in my main css file I got:
ul li:last-child,
ul li.last-child {
/* some code */
}
Another solution (albeit slower) that uses your existent css markup without defining any .last-child class would be Dean Edwards ie7.js library.