website design techniques » September 2004: “Hacking The Night Away”
most recent project
CORE BT Application Graphical User Interface (GUI) and Advanced CSS Design. Requirements included outstanding design and flexible advanced XHTML/CSS
web site design tips
This month’s website design tip is on the topic of vector vs. raster graphics.
web site design techniques
This month’s website design technique demonstrates a wacky way to fake a resizable background image in a DIV.
Hacking The Night Away, continued...
MacIE Tries To Play Fair Sometimes
If you recall from last month I rambled on about using the “* html” hack to make a CSS declaration apply itself to flavours of IE only. That’s not entirely correct but for my purposes it works. If you want to know exactly which hacks work exactly where, you’ll have to consult one of the CSS hack charts available on the net.
Any-hoo, MacIE 5.2.3, like I said earlier, actually applies CSS pretty well. The problem is that you have to use the “* html” hack to get PCIE to behave, however that same code makes MacIE misbehave. So you need to apply a hack to the hack. Eekgads!
Gimme a Double-Hack With Fries, Hold The Pickles
Basically the hack for MacIE is a malformed comment in the CSS file, which you wrap around the other hacked code:
/*\*/
MacIE ignores anything in here
/**/
In our case, the previous month’s example hacked code looked like this:
* html #content-right #SiteMapList li { height: 1%; }
If we apply the MacIE hack around that, we get:
/*\*/
* html #content-right #SiteMapList li { height: 1%; }
/**/
Once we do this, we have a declaration that only PC flavours of IE will pay attention to. That hack is very handy and works in most situations. Sometimes though, if you’ve coded yourself into a corner, which I certainly have, or if you’re working on one of “those” projects (you know, where major changes come down the pike after you’ve completed a majority of the site) then there is another way to hack MacIE that I have found very effective.
Sometimes Ya Gotta Do What Ya Gotta Do
Since the very first god-awful web page I ever coded, I’ve been a big proponent of doing what you have to do to get HTML to work for you. I guess I’m a code whore. Oh, I enjoy my dash of standards and my heaping teaspoon of “top to bottom logical code flow” or whatever you want to call it, but when it comes time for the client to get what they want I have a hard time saying, “well I could make it happen but then your code wouldn’t validate.”
Go ahead, I’ll wait for your name-calling to end before I go on...
OK, so now that we’ve all sold out, let’s move on to the next Mac hack. It’s a malformed CSS import command. Thar she blows:
@import("macie.css");
With this handy-dandy little fella you can code the night away solely for the MacIE crowd if you wish. Just put it last in line of all your CSS imports, etc, so it overrides anything that came before it. No other browsers will import this bad boy. Now you could theretically recode the entire CSS if you needed to. Heh, go for it!
