css - I used special character '#' '_' and '\' for IE browser compatibility. But now my style sheet is fail in W3c validation because of using IE hack -
I used special browsers '#' '_' and '\' IE for browser compatibility. But now due to the use of my style sheet IE hack, W3C has failed in legalization.
Now I am not able to remove these IE hack because my HTML file is now in the development of Java program.
Like my hack:
/ * for IE8 * / top: -15px;
/ * IE 7 * / # Top: -10px; IE6 * / _ for
/ * top: -1px;
Yes, do not use invalid CSS hacks, they are super-delicate.
For specific case of choosing IE, conditional comments are better. Most solutions put additional stylesheets in CC, but if you do not want to do this then you can do class switching with CC:
& lt ;! - [If IE 6] & gt; & Lt; Body class = "ie6" & gt; & Lt; [Endif] - & gt; & Lt ;! - [If IE 7] & gt; & Lt; Body class = "ie7" & gt; & Lt; [Endif] - & gt; & Lt ;! - [If GT 8 IE] gt; & Lt ;! - & gt; & Lt; Body & gt; & Lt; -! & Lt; [Endif] - & gt; And then classify all your stuff at the same place, depending on the class:
#something {top: -15px; } Body.ie7 #someething {top: -10px; } Body.ie6 #someething {top: -1px; } (It is assumed that IE8 is perfect and rules similar to other browsers must be completed, so it shows a downlevel- that CC is that everyone has classless allows you to view & lt; body & gt; .)
Comments
Post a Comment