Style sheets override HTML tags
March 28, 2011
Posted by on
I verified this in Internet Explorer 6.0, Firefox 3.6 and even a very old version of Opera, 8.5 from 2001, which I still use for email: When there are conflicting instructions for background colors or images in style sheets and HTML tags, then the style sheet instruction will override the one in the HTML tags. This can be used to advantage.
When I designed Download Central, I did not want it to be too dependent on style sheets. They define only the font, justify the margins of paragraphs and handle a few details. The background images of the pages, and the white background of the table that contains the text, are defined in the HTML tags. This ensures that a browser that does not support style sheets (Arachne, for example) will still display the pages approximately as intended.
As I have now verified, if I ever wanted to set all the pages to a single background image, or change the table color, either temporary or permanently, I could do so by just adding the appropriate instructions to the style sheet. And I could revert to the status quo ante any time by removing them again, or commenting them out.