Multiple Browser Coding Guidelines
The features of different Web browsers, such as CSS and JavaScript support, can cause Web applications to work differently from one browser to another. This lack of continuity among browsers not only causes an application to look bad, but it often causes it to break.
Acid3 Test
|
Layout Engine |
Browser |
Acid3 Score |
|
Presto |
Opera 10 |
100/100 |
|
WebKit |
Safari 4.0 |
100/100 |
|
Chrome 4.0 |
100/100 |
|
|
Gecko |
Firefox 3.5.7 |
93/100 |
|
Firefox 3.6 |
94/100 |
|
|
Firefox 3.7a2 |
97/100 |
|
|
Firefox 4.0 |
?/100 |
|
|
Trident |
IE 6.0 |
12/100 |
|
IE 7.0 |
14/100 |
|
|
IE 8.0 |
20/100 |
|
|
IE 9.0 |
32/100 |
Acid3 Test Score Chart
Tool of Choice
Conditional Stylesheets and JavaScripts
Conditional-CSS isn’t really all that interested in which browser the user using, but rather what is rendering engine the user’s browser utilizes. This is why Conditional-CSS uses ‘Gecko’ rather than the well known Firefox as one of its browser conditions. Likewise for Safari ‘Webkit’ is used. This allows other browsers using the same rendering engines to receive the same targeted CSS. An exception to this rule is made for IE (rather than using ‘Trident’) since this is what the IE conditional comments use and Trident isn’t particularly well known. Similarly for Opera, since only the Opera browser uses it’s Presto rendering engine, ‘Opera’ is used.
How to go about it?
- Choose one of the standard conforming browsers (Acid3 score 100/100) like Chrome 4.0 or Opera 10 to create and test a standard compliant Stylesheets and JavaScripts common for all browsers.
- Create a separate Stylesheet and Javascripts for each of the browser versions you want to target e.g. IE and Firefox versions.
- Include the Stylesheets and JavaScripts from step 2 by using conditional comments. This overrides the statements in the common CSS and javaScript file created in step 1.
<!--[if IE]> <style type="text/css">@import "IE-override.css";</style> <![endif]-->
#logo { margin:10px } and it doesn’t work properly in IE, you can add the same statement with a different value in your IE-override.css file: #logo { margin:20px }.
The Conditional Comment Code Examples
Target ALL VERSIONS of IE
<link rel=”stylesheet” type=”text/css” href=”all-ie-only.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”not-ie.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie7.css”>
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie6.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie6-and-down.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie6-and-down.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie7-and-down.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie7-and-down.css” />
<![endif]–>
Target IE 8 and LOWER
<link rel=”stylesheet” type=”text/css” href=”ie8-and-down.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie8-and-down.css” />
<![endif]–>
Target IE 6 and HIGHER
<link rel=”stylesheet” type=”text/css” href=”ie6-and-up.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie6-and-up.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie7-and-up.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie7-and-up.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie8-and-up.css” />
<![endif]–>
<link rel=”stylesheet” type=”text/css” href=”ie8-and-up.css” />
<![endif]–>
Learn how to develop for Android, Beyond HelloWorld
Marko Gargenta delivers a tutorial-style talk on how to develop for Google’s Android platform (beyond the HelloWorld) at the San Francisco Android User Group.
Oracle OLAP Option
The Oracle 10g Enterprise Edition OLAP Option extends the analytic capabilities of the Oracle database by providing new multidimensional datatypes, a multidimensional calculation engine, and a framework to build OLAP applications using SQL, PL/SQL and Java. Uniquely, the OLAP Option uses the Oracle database to store and manage its data, allowing you to take advantage of the scalability, reliability and manageability of the Oracle 10g platform.
