Author’s Note: This obsolete article has been retained for posterity.
The technique mentioned below applied only to Internet Explorer 5.5 and earlier. As of 2012 (ten years after this article was originally written), IE5.x market share has fallen well below 0.01% of all browser clients, and there is no justification to implement solutions for such ancient Web technology. Nowadays, a well-crafted style sheet solves the problem easily — and still allows for well-formed code, so there is no more dilemna.
If you’re a real web designer or developer, you’ve undoubtedly come across one or two problems that have incessantly plagued you — no matter what you did you just couldn’t make it turn out right in the browser.
Here’s one such example that I know has tortured quite a few developers. You’re working on a form such as a standalone select box or text input box, you want it to be very tightly integrated with some particular part of your design, and no matter what you do, either it keeps pushing down HTML elements underneath it or you can’t get it to vertically center within that part of your web page. There’s just this dåmn gap that won’t go away!
It’s actually pretty simple, but you literally have to think outside the box. Nowadays, writing well-formed code (code that has all open and close tags in the proper order) is a must. You can’t work with XML without being well formed, and it’s a fundamental requirement of the XHTML standards. Unfortunately, in this case, the real world (along with the world’s leading browser) forces you to occasionally create code that is not well formed in order to achieve the desired result. It goes against everything you’ve been taught, but put your HTML tags in the following order:
<td><form></td></form>
Your closing FORM tag actually ends up outside the table cell.
Naturally, this is an IE-only issue. Thanks again, Microsoft, for making all developers lives so much easier by introducing these quirks into your browser, so that we developers and designers have to work that much harder to obtain our stylistic goals!
Recent Comments