Jump to content

CSS specific to every browser.


dakke

Recommended Posts

Does someone know a good tutorial or guide to use css dependent on the browsers? Since IE, FF, Opera all use different rendering, it might be very useful and easier to overrule the 'general' css and go for browser specific css styles. Being new to this, I hope you guys can point me in the right direction.

Link to comment
Share on other sites

Most 'modern' browsers do not require specific css files since they are all pretty much the similar in their page rendering.An exception to the general rule above is Internet Explorer. And the good geeks over at Micro$oft have included a special set of Comment Tags for use by IE to target the Browser specific CSS required by each version of IE.Google IE Conditional Comments and have a quick read of the M$ page that pops up.

<p><!--[if IE]>According to the conditional comment this is Internet Explorer<br /><![endif]--><!--[if IE 5]>According to the conditional comment this is Internet Explorer 5<br /><![endif]--><!--[if IE 5.0]>According to the conditional comment this is Internet Explorer 5.0<br /><![endif]--><!--[if IE 5.5]>According to the conditional comment this is Internet Explorer 5.5<br /><![endif]--><!--[if IE 6]>According to the conditional comment this is Internet Explorer 6<br /><![endif]--><!--[if IE 7]>According to the conditional comment this is Internet Explorer 7<br /><![endif]--><!--[if gte IE 5]>According to the conditional comment this is Internet Explorer 5 and up<br /><![endif]--><!--[if lt IE 6]>According to the conditional comment this is Internet Explorer lower than 6<br /><![endif]--><!--[if lte IE 5.5]>According to the conditional comment this is Internet Explorer lower or equal to 5.5<br /><![endif]--><!--[if lte IE 6]>According to the conditional comment this is Internet Explorer lower or equal to 6<br /><![endif]--><!--[if gt IE 6]>According to the conditional comment this is Internet Explorer greater than 6<br /><![endif]--></p>

Link to comment
Share on other sites

Hi,Thats the best way indeed, but you can also create a JavaScript file witch will scan what browser the user is using and than would load the correct CSS file according to the browser that user is using.Complements \o/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...