Anne van Kesteren

Internet Explorer extended underscore hack

I guess most people know the invalid, but well-formed, underscore hack in CSS. Mostly I use: _height:1%. (Sets hasLayout to true.) However, as I discovered together with Rob Vermeulen when working for VPRO Digitaal you can use much more prefixes (and use them together):

<!DOCTYPE html>
<style>
 html{
  background:lime;
  !@#$%^&*()_-+=/?.,|[]{;:<>background:red;
 }
</style>

As may be completely obvious to the most of you, the above gives a red background in Internet Explorer. Proof.