I don't know why it never occurred to me before to do this, but for some reason today I was inspired to see whether a browser would apply style rules to a block defined by an arbitrary tag. I created a block that looks like this:
<melvin>This is Melvin</melvin>
...then I added a style container and applied a style rule to the entity "melvin" (e.g., melvin { background-color: #000000;}). And it worked, in both Safari and Firefox. Seems to work for doctypes all the way from html 4.01 transitional all the way through xhtml 1.1 strict.
Should it? Why? And if so, would it be a reliable technique? I've never heard of this before.
Bonus question: Am I a sad, sad geek for thinking this is cool?
That said: I am also a Mac user, so I can't test this on IE for you. But IIRC, tags that aren't understood are supposed to be ignored. So while it might not validate, it should be possible to use it and have it degrade gracefully.
posted by spaceman_spiff at 11:15 AM on July 6, 2006