Tuesday, March 15, 2011

Duh... Declare a doctype!

I've been implementing the Blueprint CSS framework along with CFWheels lately and ran into a couple of hours of headaches today with the display in IE.
Spans were not displaying correctly. It was like IE didn't recognize the width assigned to the spans. IE also wasn't displaying the colborder correctly and there was this horrid 5 to 10 pixel gap between divs.
I had all kinds of things going on (a jquery cycle, a dropdown menu, etc) so I initially thought that all these things just weren't playing well together like naughty children.
I worked around things in an IE specific css file and then it occurred to me - I didn't have a doctype declared.
That was the root of all the IE display problems. Once I declared a doctype, I was able to eliminate all the workarounds I had so painstakingly created over the last couple of hours.
So next time, I will check to make sure I've declared a doctype first!