11 2005

A safer Holly Hack for IE7+

#elementNeedingHasLayout {zoom:1}

Why this over the original Holly Hack?

  • “* html” won’t select elements in IE7 in Standards Mode, so all the HH’s now in use will drop away, but the bugs they were used to fix may not.
  • If the IE/win team should fix height (broken since v5.0), the HH’s use of height:1% (or any explicit value) could wreck many layouts. Setting zoom allows us to leave height as “auto”.
  • “zoom” is likely too vaguely named to be a property in a future W3C CSS recommendation, so even without conditional comments, zoom:1 is invalid, but harmless.

One Comment on “A safer Holly Hack for IE7+”

  1. Thank you Steve,
    this solved one of my problems with IE7 where I had used the Holly Hack previously.

Leave a Reply

Elements allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>