tags:

views:

182

answers:

2

Select all the CSS hack(s) that IE6 can understand for class red

<p class=”red”>text</p>

<!—[if IE 6]> .red{color:red}>![endif]-->
.red{_color:red}
.red{*color:red}
* html .red{color:red}
.red{color:red}
  1. Line 1, 3
  2. Line 2, 3
  3. Line 2, 4
  4. Line 1, 2, 4
  5. All of the above

I encounter this question in a quiz. Don't have IE6 in my pc to experiment with but curious to know the answer.

My additional doubt, 6. Which one is valid/suggested? 7. Is it still need to hack IE6 even after release of IE8? I don't expect a lengthy discussion on this. Just yes/no will do. My intention is to know how fellow coders feel about it. :-)

A: 

If I remember correctly, they all work. unless I'm confusing the * html for * > html, although I don't think they make a difference.

also, if they are asking for ONLY hacks, then obviously 5 wouldn't work because it's valid CSS, in which case pick 4 because I think *color is iffy. I don't believe that's a real hack.

Eugene Bulkin
A: 

Is it still need to hack IE6 even after release of IE8?

No...things get easier. But customer expections go higher and hgiher too. :-)

Check out some my questions related to that topic:

Conditional Comments Question

Collect6ion of Browser Characteristics

bastianneu