How to avoid breaking IE conditionals

Tuesday, October 22nd 2013

Early on in a front end developers career they're going to encounter the beauty of IE conditionals. Ya know, something like this:

Those can be a lifesaver. Literally. But, what you may not know is that those conditionals syntax can be very picky. This one is wrong and won't work in most versions of IE.

Can you spot the difference? It's the spaces in the opening and closing tags. It took me a half hour to figure out that little space can break the entire block of code. I hope no one else runs into this problem! It was a fun one to track down.