Validate Your CSS!
Today, I continued my lessons on CSS.
I’d spent a fair while trying to work out why a new site I’m working on looked great in Avant Browser (which is essentially Internet Explorer), but in Firefox, it wasn’t picking up my stylesheet at all.
Being aware that Firefox does have a few “quirks”, I started doing my research, on Google, trying to find out what might be the cause of this problem.
I was led up a couple of garden paths before I came across the blindingly obvious way to diagnose the problem – validate your CSS!
As I had subsequently found that the same issues were present with both Safari and Opera and thus realised it probably was something fundamentally wrong with my code, I heeded the advice, popped over to the W3C CSS Validation Service, pasted in my CSS code and clicked the Check button.
Sure enough, it found a parsing error – there was a round bracket instead of a curly bracket! – which I fixed and, lo and behold, my stylesheet was now being picked up and used in all four browsers, looking exactly as it was meant to.
So, my lesson for the day is: validate your CSS code, as it’s a lot quicker than spending hours of frustrating research that may not lead you anywhere.
Tags: internet explorer, css code, garden paths, w3c css validation serviceBELIEVE IT OR NOT:
Powered By Odd Facts
