Exemplo do tutorial Ativando .hover e .first-child no IE 6 - um novo método do blog El Micox

Test First child

Test hover

Test First child

Test hover

Test First child

Test hover

Código fonte


<style>
/* Micox Pseudo-class-css2 to IE (MXPC). Activate .hover and .first-child in IE 6 */
* html * { color: expression( (function(who){ if(!who.MXPC && who.nodeName != 'A'){
	who.MXPC = '1';
	who.onmouseenter=function(){ who.className += ' hover'};
	who.onmouseleave=function(){ who.className = who.className.replace(' hover','')};
	(who==who.parentNode.firstChild) ? who.className += ' first-child' : '' ;
} } )(this) , 'auto') }


p:first-child , p.first-child { color: green }
p:hover , p.hover { color: blue }

/* test in child-child-childs */
div:hover div p , div.hover div p { font-weight: bold; }

div { border: 1px dotted black; margin-left: 15px }
</style>
</head>

<body>
<div>
	<p>Test First child</p>
	<p>Test hover</p>
	<div>
		<p>Test First child</p>
		<p>Test hover</p>
	</div>
</div>
<div>
	<p>Test First child</p>
	<p>Test hover</p>
</div>