<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br/> <HTML xmlns = "http://www.w3.org/1999/xhtml"> <br/> <pead> <br/> <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 "/> <br/> <title> CSS hack: distinguish IE6/IE7/IE8/Firefox </title> <br/> </pead> <br/> <MCE: style type = "text/CSS" Media = "screen"> <! -- <Br/> P. IE {<br/> Height: 60px; text-align: center; line-Height: 60px; Border: 1px dashed # BBB; Background: # f7f7f7; Font: 15; <br/> color: Blue; // all browsers <br/> color: brown/9; // all IE browsers <br/> + color: red; // IE7 <br/> _ color: green; // IE6 <br/>}< br/> --> </MCE: style> <style type = "text/CSS" Media = "screen" mce_bogus = "1"> P. IE {<br/> Height: 60px; text-align: center; line-Height: 60px; Border: 1px dashed # BBB; Background: # f7f7f 7; Font: 15; <br/> color: Blue; // all browsers <br/> color: brown/9; // all IE browsers <br/> + color: red; // IE7 <br/> _ color: green; // IE6 <br/>}</style> <br/> <body> <br/> <P class = "ie"> <br/> <span style =" display: block; display: NONE/9; "mce_style =" display: block; display: NONE/9; "> Hey hey, I used Firefox and blue text. </Span> <br/> <! -- [If IE 8]> pretty good, very advanced. Use IE8! The text is brown. <! [Endif] --> <br/> <! -- [If IE 7]> you, IE7, red text! <! [Endif] --> <br/> <! -- [If IE 6]> although green text is displayed, IE6 is not a good thing! <! [Endif] --> <br/> </P> <br/> </body> <br/> </ptml>