Browser detection

Some days ago I finished a site but it was only coded (CSS) for a perfect view in Firefox 3 and IE 6. I’ve neer had a CSS file for IE 7 since I dont use it but when viewing the site on a computer that had IE 7, it had some minor problems…so I decided it was time to create the IE 7 CSS file.

Searching the web, this is what I ended up with:

<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="ie7.css" />
< ![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
< ![endif]-->
< ![if !IE]>
<link rel="stylesheet" type="text/css" href="firefox.css" />
< ![endif]>

The only problem is that it is not XHTML standard…

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

This entry was posted in CSS Tutorials. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

You must be logged in to post a comment.