While using :first-child :last-child , in css its works fine in IE7, FF.
Is there any possible fix for this.
Use of Javascript is fine. If it works without javascript it would be great.
You can use a semantic class name to ease your suffering in IE6. Something like:
<ul>
<li class="first">First Item</li>
<li>Second Item</li>
<li class="last">Last Item</li>
</ul>
And then in your CSS use:
ul .first { color: #F00; }
ul .last { color: #00F; }
Thanks all,
Here is the javascript version which I finally used for this Solutions.
<script>
$(document).ready(function(){
$("ul li:last-child").addClass("last");
$("ul li:first-child").addClass("first");
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With