For all browsers, except for…

There are three thing you can do to solve the problem of the MS boxmodel.
1. Use a hack in CSS
Tanteks hack is probably the most useful of al the hacks
2. Insert adapted CSS
Only insert a list of rules that needs fixing, so rules where width is applied and fail the boxmodel. Serverside browser sniffing and insertion seems to be the best way to do this.
3. Recalculate the boxmodel
Use Javascript to recalculate the MS boxmodel on affected browsers in quirks mode

I’ve reworked the frontend of this again so that I no longer needed a boxmodel hack. Nobody likes hacks, not really, no matter how much they like Tantek. Also there is almost no browser specific parsing with PHP, except for removing flash from NN4 (homepage). NN4 uses a small ‘minimal’ styleheet and doesn’t need the .swf file. Alas I haven’t yet found a more elegant way to remove or hide flash from the screen.
In the previous coded version of this site I used the second solution. I inserted CSS code, 2 lines in all, to fix the errors caused by the boxmodel. This had to be removed because I’m now caching the ‘links’ page. This page is now parsing 7 news feeds after every 4 hours instead of every pagehit, multiple news feeds are too slow to parse. The actual cache generating is done by an ‘unlucky’ user, the first one to visit after the set time interval. If this person uses the old Netscape 4 then that’s the version everybody else gets to see. And for this reason I moved on to the third solution, Javascript.

With code from Javascript now recalculates the Microsoft boxmodel. Although I did need to do some debugging and now it does seem to work. Opera 5 and 6 still have problems with the navigation menu, it’s all over the place and this because I use width:auto in the stylesheet. This should be fixed, and I will, as soon as I find out how. Opera 7, however, works great and proves again that it really is one of the best browsers on the market. And it’s a pity that future versions may no longer be available to Apple users. But never mind, Safari will become king of that jungle anyway.

Next entry: CSS for designers
Previous entry: In my own words eh pictures