Hiding blocks of CSS from IE5.x

Written January 19. 2006, at 13:55 GMT.

To reliably hide blocks of CSS code from Internet Explorer 5.x (while having them render in virtually all other browsers) I've started to use this nasty little filter:

#rule1 { color : blue; }
i{_content:"\"/*"}
  #rule2 { color : green; }
*/ *{}
#rule3 { color : red; }

All browsers render all the rules, except in IE5.x which conveniently skips over #rule2.

This trick is a slight variant on the so-called Inline High-Pass Filter and I document it here for future reference.


More like this: English Entries, HTML/CSS.


Reader Comments (1)

  1. Siggi Sveinn replies:

    This reminded me of the trick I'm using to hide sertain portions of a page from the view of IE-users while hiding other parts from other users:

        /* Hide from IE-users */
        .ie_hide { _display: none; }
    
        /* Only show to ie-users */
        div[class='blah'], .ie_text { display: none; }
    

    January 23. 2006 kl. 09:10 GMT | #

Ţessum svarhala hefur veriđ lokađ. Kćrar ţakkir til ţeirra sem tóku ţátt í umrćđunni.


 

Flakk um vefsvćđiđ



 

Nýleg svör frá lesendum

  • Rich (Req.js - javascript lazy-loading and dependency managment made easy)
  • Rich (Req.js - javascript lazy-loading and dependency managment made easy)
  • Rich (Req.js - javascript lazy-loading and dependency managment made easy)
  • Már (Req.js - javascript lazy-loading and dependency managment made easy)
  • Rich (Req.js - javascript lazy-loading and dependency managment made easy)
  • Már (Req.js - javascript lazy-loading and dependency managment made easy)
  • Dinesh (Req.js - javascript lazy-loading and dependency managment made easy)
  • Már (Taubleyjur í nútímanum - lítill leiđarvísir handa hrćddri ţjóđ)
  • Ada (Taubleyjur í nútímanum - lítill leiđarvísir handa hrćddri ţjóđ)
  • notandi (Taubleyjur í nútímanum - lítill leiđarvísir handa hrćddri ţjóđ)
  • Geir (Lausnin á efnahagsvandanum)
  • Jenný (Lausnin á efnahagsvandanum)
  • Óli Jens (Lausnin á efnahagsvandanum)
  • Már (Lausnin á efnahagsvandanum)
  • Kjartan S (Lausnin á efnahagsvandanum)

 

 

Yfirlit yfir ţetta skjal

(Atriđin í listanum vísa á ákveđna kafla ofar á síđunni.)