All Guides

Star HTML Hack

The Star HTML Hack (or Star Selector Hack) used CSS selectors like * html to target Internet Explorer 6 specifically, exploiting IE6's incorrect parsing of the universal selector when applied to the html element. This technique allowed developers to serve IE6-specific CSS rules without affecting other browsers, becoming one of the most widely used CSS hacks. “css /* Standard styles for all browsers */ .container { width: 800px; margin: 0 auto; } /* Star HTML hack - only IE6 reads this */ * html .container { width: 780px; /* Account for IE6 box model bug */ text-align: center; /* IE6 centering workaround */ } /* More star hack examples */ * html .float-fix { display: inline; /* Fix doubled float margin bug */ } * html .min-height { height: 300px; /* IE6 doesn't understand min-height */ }

Why Star HTML Hack Matters

The Star HTML Hack exemplified how developers exploited browser bugs to solve compatibility problems, creating a cat-and-mouse game between CSS hacks and browser fixes that complicated web development for years. While effective, these hacks demonstrated the fragility of relying on bugs rather than standards and influenced the development of more robust feature detection and progressive enhancement techniques.