Skip to content
Tech News
← Back to articles

CSS Curiosities of the Past

read original get CSS: The Definitive Guide by Eric Meyer → more articles
Why This Matters

A retrospective on browser-specific CSS hacks — the IE star hack, underscore hack, and IE7's loose parsing of '!important' — documents how developers coped with inconsistent rendering engines before standards convergence. It's a reminder that much of modern CSS's reliability was won by escaping an era where bugs doubled as targeting tools.

Key Takeaways
Worth a Look

CSS: The Definitive Guide by Eric Meyer — If a tour of star hacks and IE-era CSS oddities has you curious about how the language actually works today, Eric Meyer's CSS: The Definitive Guide is the classic deep dive. It walks through selectors, the cascade, and layout in detail, making it a great companion for anyone who enjoys the history and the modern specs alike.

See CSS: The Definitive Guide by Eric Meyer on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.

The ebbs and flows of the web have gotten us to where we stand today. We simply wouldn’t have the web we do without the journey it has taken us to get here. However, some of the steps it has taken to get here have been interesting to say the least.

CSS is how we style things on the web, but since its inception it has been made, on occasion, to wear a few more hats. It has taken on odd roles and picked up behaviours it probably ought not to have. Such is life.

As I’ve detailed odd and context-specific HTML , this is a look at CSS largely outside the specifications. Browser-specific hacks, technology-scoped syntax, and engine-exclusive snippets forged from questionable circumstances, corporate complications, and esoteric implementations.

Property Parsing

width : 300px ; * width : 250px ; _width: 200px ; - width : 200px ;

Most browsers, correctly, would treat a property prefixed with an asterisk as invalid. However, Internet Explorer 7 and earlier would treat it as valid. It was so famous it garnered the name ‘star hack’ for the shape of the asterisk. Likewise, when prefixing a property with an underscore or hyphen, only Internet Explorer 6 would treat it as valid. There were many more similar hacks used, the vast majority of which are best documented at the eponymous browserhacks.com. The main gist is that some browsers would incorrectly parse properties, selectors, and values, and that could be used for gain in an era where browser behaviour was rather varied.

Limiting CSS to apply only in certain browsers with conditional comments in CSS files, such as could be done in HTML documents, wasn’t possible. Therefore, this exploitation of questionable parsing of what is and isn’t valid was commonplace for targeting specific browsers.

Important

background : red !interesting;

Internet Explorer 7 and earlier would treat almost any textual string prefixed by an exclamation mark as !important . Most commonly, people would make use of this by writing !ie to have a style only override specificity in Internet Explorer. As far as Internet Explorer was concerned, the arbitrary !banana and the specced !important were the same, while other browsers correctly only accepted the latter.

... continue reading