
25
2010Be Sure Your Sites Are Cross Browser Compatible
When creating a new website it’s very important to make sure that each section of every page throughout your site is compatible with all major browsers. Many developers have run into this issue before where for example they spend hours and in some cases days on building and customizing their CSS code for a new site or page, checking the progress in only one browser like Firefox only to find out that their layout is inconsistent in other major browsers such as Internet Explorer.
It’s highly recommended that during the initial development stage you check the progress in all of the most commonly used browsers such as Firefox, Internet Explorer, Chrome etc… You can save yourself a lot of time in the long run and prevent frustration by doing so.
First of all, make sure your CSS code is validated and follows all CSS standards. Keep in mind that even if your CSS code does follow all standards, it is still recommended to manually check your progress in each major browser. In some cases, in fact it’s quite common that you will need to write custom CSS code for individual browsers. To apply different external CSS files depending on browser type and version you can do so by using the following code in the HEAD section of your HTML page
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6styles.css" />
<![endif]-->
If you want to hide specific CSS files from certain browsers such as Internet Explorer in this example simply apply the following code
<![if !IE]>
<link rel="stylesheet" type="text/css" href="not-for-ie-browser.css" />
<![endif]>
Hope this helps, be sure to visit again soon for more website development tips and tutorials.







