If you’ve created your website but want to style or change the formatting of your css depending on the users browser version, ie allows you to set a different css style sheet using this handy little hack.
Internet explorer recognises the following:
If you need to target any users browser that is just internet explorer simply use the follwoing code and place in your <head> </head> tags.
<!--[if IE]>
<link rel=”stylesheet” type=”text/css” href=”css/ie.css” mce_href=”css/ie.css” />
<![endif]–>
If you need to target any users browser that is internet explorer below version 7, e.g. 6, 5, 5.5… use the following code and place in your <head> </head> tags.
<!--[if lte IE 6]>
<link rel=”stylesheet” type=”text/css” href=”css/ie6orlower.css” mce_href=”css/ie6orlower.css” />
<![endif]–>
Tags: CSS, css hacks, internet explorer