Testing CSS has been a hurdle for many web developers and their HTML-based projects. This article contains a proposed workflow for fixing CSS discrepancies found during CSS testing.
What is a Browser Testing Suite?
A browser testing suite captures screenshots of web pages as they appear in different browsers and different operating systems. Visit this site to see a list of available browser testing suites. I use browsershots because of its price point (free).
Testing Procedures
- Start with an HTML-based page
- Create two standards compliant CSS files:
css/screen/layout.csscss/screen/site.css
- Include the default layout and site CSS files in the HTML header
- Test your work with a browser testing suite
- If there are display differences between browser versions following the steps outlined below
Fixing CSS for a Specific Browser
IE6 is the culprit in the following example:
- Duplicate the compliant layout CSS file and rename
it layout_IE6.css - Modify the layout_IE6.css files for IE6 compatibility
- Use a scripting language to inject the IE6
links after the standards compliantlinks. Refer to this post for details - Test your changes with a browser testing suite. You’ll only need to run tests for IE6
- Don’t delete unchanged styles from the IE6 CSS file