Any solution for reducing browser compatibility problem while writing css style.
views:
152answers:
5These three are the main points you need to do yourself:
- Write correct markup - make sure it validates
- Make sure your markup is in standards mode
- Write correct CSS - make sure it validates
In addition, you can do some of the following to reduce the amount of headache:
- You can use a CSS framework, like Blueprint, 960.gs, YUI CSS library, etc.
- For Internet Explorer -related issues, there is ie7.js and ie8.js
Well, as of now there is nothing like fixall() which will make all browsers compatible...however, you can reduce compatibility problems by using the correct doctype. Read thisarticle on using doctypes. Also, validate your markup.
Edit: You can go to Browser shots to see screenshots of your web design in different browsers.
Simple -- test, test, test.
First thing, you should have at least these browsers on your computer: FireFox3.5B , InternetExplorer7 (+ optional Safari 3, Google Chrome 2 Beta and Opera).
Now for a more definite answer:
- avoid css3 styling like "opacity" et cetera as CSS3 is not a standard yet. Instead use Javascript libraries like jQuery to apply those effects selectively
- avoid png transparency like the plague... instead use dithered gif transparency (this is now somewhat old, as it now works on IE7+)
- Test and test and test
- Know how HTML and CSS work
- Test in all browsers you target
You may also want to use a CSS reset file to start on the common ground.
Discipline!
- Validate your HTML. Use a correct DOCTYPE.
- Use standards, hack the bugs.
- Be descriptive, or use a reset stylesheet.