CSS comments in MSIE v6

bodmas fluid blue theme in blue MSIE 6 ignores forward slash style comments in CSS

The Fluid Blue WordPress theme has a liquid main column width so it suits smaller displays (web books, old monitors in College staff rooms) well. I changed the default blue colour scheme to orange and brown one Sunday afternoon some months ago. I kept the old CSS and just commented them out using ‘//’ at the beginning of the line. Then I added my new Orange/Human colours.

I decided the change the colours back today. Bright Idea, just uncomment the original ones and put ‘//’ characters in front of the orange lines. Worked fine in Firefox, but found that MSIE v6 on Windows XP would not change from orange. Flushed the history and cache. Restarted….

Then the penny dropped: MS Internet Explorer was ignoring the comment characters ‘//’ at the start of each line. When I changed the colours from blue to orange, the site rendered correctly because the orange colours were set last (CSS files are interpreted line by line and the last setting of an attribute wins). When I swapped the comment characters around, the commented out option was below the option I wanted. So MSIE reset the colour to orange.

I need to check what happens in MSIE 7 as well. Many College PCs run MSIE 6 on older hardware. Later versions of Microsoft Explorer support more of the CSS 2 and CSS 3 standards so some quite snazzy layouts will become possible soon.

Comments are closed.