Defeating browser incompatibilities
Peter-Paul Koch has unveiled his new site, QuirksMode.org, which features over 150 pages of cross browser CSS and javascript tips and tricks. Five months in the making, there’s just too much good stuff to link to individual pieces here so my best recommendation is to head on over there and spend some time browsing around. I’ll make an exception though in linking to the Table of Contents script, which uses the DOM to create an additional navigation bar linking to each of the level 2 and 3 headers on a page. Another great example of the power of structural markup.
It looks like a useful resource, but I have to take issue with a few things.
He criticises the W3C for not including the <wbr> "tag" (it's an element type), yet doesn't mention the fact that Unicode, used by both HTML and XHTML, already provides that functionality, so adding a presentational element type would have been completely superfluous.
He claims that XHTML doesn't provide the ability to use custom attributes - what about namespaces? Okay, so they aren't well-supported yet, so I was going to give him that one - except I found he wanted to use them for a job that other attributes are designed for! Instead of <a href="..." type="popup">, what's wrong with class="popup"? Or, if you are using popups for a particular reason, what about rel="online-help"? It seems he's ignoring the capabilities of existing document types, inventing his own non-standard way of doing things, and then complaining about it!
He states, in essence, that he chooses "quirks mode" to avoid doctype switching. That doesn't make sense. The switching is still taking place, he just chooses the traditional mode over the mode that is closer to the specifications. Needless to say, I think that's an extremely poor decision.
I think I'm going to use the website for information on browser bugs, but take any advice I find in there with a pinch of salt, I'm afraid.
Jim Dabell - 29th October 2003 20:48 - #
Randy Towers - 29th October 2003 20:55 - #
Simon Willison - 29th October 2003 21:02 - #
Mark - 29th October 2003 22:28 - #
Simon Willison - 29th October 2003 22:38 - #
liorean - 29th October 2003 22:48 - #
I would like to know how he came to this conclusion: "Well-formed HTML documents are XML documents..." Furthermore I totally agree with Jim's leading paragraphs.
Robert Wellock - 30th October 2003 11:34 - #
I see PPK as a good self-taught coder. Though is not kind with the W3C standards and have some times some non academic methods, his work is above the average and a great ressource for the web-dev community. I've used his DOM compatibility tables as a reminder for a while.
Robert Wellock: Actually, well-formed HTML is almost XHTML, and XHTML is the XML formulation of HTML. He took a shortcut but many XML process can be use with HTML.
P01 - 30th October 2003 14:16 - #
Can someone explain this in more detail? In CSS-based designs a fixed-width box with normal (visible) overflow normally results in a long word/URL 'breaking out' of the containing box and obscuring other content to the right. I'd love to know how to insert a line-break that's more practical than the ­ soft hyphen ;-)
oli - 31st October 2003 05:30 - #
oli, this works:
I simply styled a
spanelement to have zero width and font-size. However, text still breaks around the space inside the element. Thus a "zero-width space." Here's an example:hello<style="font-size: 0; width: 0"> </span>mom<style="font-size: 0; width: 0"> </span>hello<style="font-size: 0; width: 0"> </span>mom<style="font-size: 0; width: 0"> </span>hello<style="font-size: 0; width: 0"> </span>mom<style="font-size: 0; width: 0"> </span>hello<style="font-size: 0; width: 0"> </span>momOf course, you could set up an entity to hold that code, or make the rule the default style for span elements. Here is a way to declare an entity (note: you can add the PUBLIC Identifier after the
htmland before the[.I called the entity ybsp for "yes break space." :-) Here's an example:
Hello&ybsp;mom!&ybsp;Hello&ybsp;mom!&ybsp;Hello&yb sp;mom! ...Then you can type the entity (&ybsp;) to save your fingers (and bandwidth)! Hope that helps.
Jimmy Cerra - 31st October 2003 06:31 - #
I assume the peculiar "shortcut" he was considering involved looking at XML documents as conforming SGML documents. It was only because he said they "are" which was of interest not that they were relatives or could be accessed via the DOM, but at least his statement has been cleared up.
Robert Wellock - 31st October 2003 09:57 - #
michael - 15th August 2005 03:32 - #