You can simply use this rule :first-childto set a specific value, and then get the computed style in Javascript to see if the rule applies :first-child, for example.
<style>
#foo { width: 200px; }
#foo:first-child { width: 400px; }
</style>
<span><span id="foo"></span></span>
<script>
if ($('#foo').width() < 400)
alert('first-child not supported.');
</script>
(This is not verified. I do not have IE 6.)
source
share