Send us a message

Thumbnail

Cross browser compatibility

Sep
9

Cross browser compatibility - Why do browsers work differently?


Building a website to work correctly over multiple browsers is a task that all web developers have to undergo with any website build. Often it is a particularly frustrating task as different browsers can act in very different ways, especially IE!

A website browser works by taking a HTML document and translating it into a organised web page that is then displayed by to the user. The World Wide Web consortium outline the basic rules for translating HTML documents into a web page (who also publish the official HTML standards guide). However, these basic guideline rules are open to a certain amount of interpretation.

As an example, HTML standards state a TABLE tag should support a CELLSPACING attribute that will define the whitespace within the table structure. However, web standards don't provide a default value for CELLSPACING, so without defining CELLSPACING during construction, two different browsers may use different default CELLSPACING values and therefore create different levels of white space in the table. A further problem is browser support for the rapid development of HTML standards. Browsers can often be behind the development in terms of their support. As a result, browsers can be attempting to translate code it doesn't understand and therefore ignores it, affecting the way in which the page is displayed.

How to deal with cross-browser compatibility issues


The best way to reduce issues with cross-browser compatibility is to take into consideration the issues that can arise from the very beginning of a website build. From a basic level this includes avoiding the use of HTML extensions and being cautious about using newly developed features of your chosen programming language that may not yet be supported by all major browsers.

It is also a good idea to test all web pages with the HTML Toolbox and analyse its Browser Compatibility report.

It is vital to recognize that building a website that works perfectly across all versions of all browsers running on every platform, is a very difficult task and in many cases not possible. You must also accept that in trying to create a fully cross-browser combatable website, there will be a requirement to drop functional aspects & other features that you may wanted to have on your website. Therefore, the first major step is to establish which browsers are the most important to you and more importantly your target audience. It is easy to obtain statistics on browser usage and this will help you to understand which browsers are most popular & most used.

Below is a table showing browser popularity statistics between January & August 2010.

2010

Internet Explorer 6,7,8

Firefox

Chrome

Safari

Opera

August

30.7 %

45.8%

17.0%

3.5%

2.3%

July

30.4 %

46.4%

16.7%

3.4%

2.3%

June

31.0 %

46.6%

15.9%

3.6%

2.1%

May

32.2 %

46.9%

14.5%

3.5%

2.2%

April

33.4 %

46.4%

13.6%

3.7%

2.2%

March

34.9 %

46.2%

12.3%

3.7%

2.2%

February

35.3 %

46.5%

11.6%

3.8%

2.1%

January

36.2 %

46.3%

10.8%

3.7%

2.2%



The table does not include such browsers as Netscape or IE5, IE4, IE3 etc. While a small number of people still use these browsers, there simply isn't a high enough number to justify the time required to design pages for them. Cross-browser compatibility can be a daunting task but can be made a lot easier by ensuring you know what browsers you are focussing on and planning for the potential issues that can arise.