hi all,
I want to use a single css file for different types of browsers.. can anyone give me a guide line on how to develop it ?? Am new to programming....Pls help...
hi all,
I want to use a single css file for different types of browsers.. can anyone give me a guide line on how to develop it ?? Am new to programming....Pls help...
CSS contents and browser compatibility may be of use to you. Also see http://www.w3schools.com/css/
The CSS that you can use in a cross browser compatible style sheet is a subset of the standard, where you avoid styles that some browsers have problems with. (Where "some browsers" often is Internet Explorer.)
For example, the text-align
style is not properly handled by Internet Explorer. It applies the style to block elements also while it should only be applied to inline elements. Therefore you should only use the text-align
style on elements that doesn't contain any block elements.
Develop the page using a standards compliant browsers, like Firefox, as the first testing ground. When it works in Firefox it will almost always look the same in all other browsers except Internet Explorer. Eventhough IE is the most used browser, it's the odd one out when it comes to web standards, and you often has to tweak the HTML and CSS to avoid rendering errors in IE.
Sometimes IE needs a specific size on elements that are sized automatically in other browsers. Another example is adding display:inline;
to a floating element. All floating elements are block elements so the display:inline;
style is ignored, but in IE it has a side effect of setting a HasLayout flag for the element, which fixes some other problems that IE has with floating elements.
You need a proper doctype on your page so that it renders in standards compliant mode. Otherwise you will have a very hard time getting a consistent look across browsers.