So far you have everything right.
<!--this is an HTML comment-->
/**this is a CSS Comment**/
Conditional comments for IE are ignored by ALL browsers except IE9, 8, 7, 6.
IE10 no longer pays attention to conditional comments.
Interesting-- so, old IE reads comments to see if they contain conditional statements, and executes them if they do, but otherwise ignores them if they are just comments? Put another way, how does old IE know that a comment contains a conditional statement unless it "reads" the comment?
I guess the reason I'm struggling a bit with this is that in other types of programming I've done, such as Visual Basic, a comment is ignored by the software executing it-- even if the comment contains executable code (in fact, you can troubleshoot code by "commenting out" a line).
But your response was very helpful, Nancy. Thanks!
1 person found this helpful
Comments are ignored. Scripts inside comments won't execute.
IE Conditional Comments are hacks. They always begin with an IF statement which only IE browsers see.
<!--[if lt IE 9]>
Why did MS do this? To mitigate the fact that IE browsers are not standards compliant. Instead of fixing the problem like they should have done a decade ago, MS decided to make a window so developers could workaround the serious shortcomings in these inferior browsers. Nice, huh?
IE10 promises to be standards compliant thus won't need any hacks. Cross your fingers.