Posted By

charmcitycoder on 11/18/08


Tagged

css hack ie safari empty Firefox


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

charmcitycoder
jeremyhcobb


IE Hack with :empty attribute


 / Published in: CSS
 

URL: http://www.ibloomstudios.com/articles/the_ie7_css_hack/

Kudos to Nicholas Gagne for this.

From his site: The :empty selector is part of the CSS3 specification, and although it is not accurately supported by Safari, it will still select the element (whether it is empty or not)..... With this IE7 CSS hack you will be able to apply specific styles that will only affect all versions of Internet Explorer including Internet Explorer 7.

  1. /** Set IE styles here **/
  2. #homepage {
  3. margin-left:15px;
  4. margin-bottom:-13px;
  5. }
  6.  
  7. /** IE doesn't recognize the empty tag, so make adjustments here for other browsers **/
  8. #homepage:empty {
  9. margin-bottom:-10px !important;
  10. }

Report this snippet  

You need to login to post a comment.