Thursday, August 4, 2011

Putting on the CSS hat

I mentioned last post that I ran into some trouble when I made my CSS dynamic. Turns out I just forgot a line in the file, but it's a pretty interesting line. Some of our pages used the CSS correctly, some didn't. I found out that in ones that didn't, deliberately breaking the HTML would make it start to work. And then I realized it was just another quirks and standards thing.

HTML is a member of the Frankenstein family. A lot of it is just something somebody added because they needed it or wanted it at the time. Almost two decades ago was the first of the browser wars, in which each browser pretty much made up its own standards. Many site creators didn't even bother with standards and just made broken sites, and couldn't even tell because HTML and CSS don't tell you anything. They just bend over backwards trying to accommodate you, until they break without giving a clue as to the cause. *grumble grumble*

Anyway, modern browsers still have to render these old sites. They do this by using multiple operating modes. If it's a good website, they're in Standards mode. If they encounter errors, they go into Quirks mode, and become much more forgiving. (Browsers differ slightly in the number and type of modes.) Breaking my HTML made Firefox go into Quirks and accept my wonky dynamic CSS. Although I am flattered that it liked my site well enough to stay in Standards mode....

All I needed to do was use PHP to basically put a CSS hat on. It sends out a message saying, "Hey! I'm actually CSS, not anything else." Pretty cool.

I've mostly been trying to fix the question map. You can access it on my site by clicking the big line graph, but the look is broken. It should function, though. I also dismantled a(nother) computer Andrew found. This one was broken, though, so we cannibalized it and threw it back on the dump. And no Office for Alec yet, but I did find Brett today.

No comments:

Post a Comment