Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > CSS hack for IE 6?

Reply
Thread Tools

CSS hack for IE 6?

 
 
delerious@no.spam.com
Guest
Posts: n/a
 
      12-23-2003
I've read about the child selector hack (using something like html>body as a
selector in the stylesheet), which is good when you want to use styles for all
non-IE browsers.

Is there a hack just for IE 6? I want to apply a style to IE 6 browsers but
not IE 5.x browsers. It would be OK if the hack worked for non-IE browsers
too, just as long as it excluded IE 5.x browsers.

 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      12-23-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

>I've read about the child selector hack (using something like html>body as a
>selector in the stylesheet), which is good when you want to use styles for all
>non-IE browsers.
>
>Is there a hack just for IE 6? I want to apply a style to IE 6 browsers but
>not IE 5.x browsers. It would be OK if the hack worked for non-IE browsers
>too, just as long as it excluded IE 5.x browsers.


Have a look at http://centricle.com/ref/css/filters/ and the various
linked pages. Several ways to hide styles from IE5 but not reveal them
to IE6.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      12-23-2003
delerious wrote:

> Is there a hack just for IE 6?


There are various hacks for different combinations of browsers. By
combining several, it is usually possible to get a combination that works
in any browser you like.

Here is a hack to make some element (#mydiv) blue in IE 6, but red in
other browsers.

#mydiv { color: red; }
#mydiv {
\color: red;
c\olor: blue;
}
html>body #mydiv { color: red; }

Untested, but should work.

IE 6 sees the first three 'color' properties, but not the last. IE 5 only
sees the first two. Opera 6+ and Gecko see them all. As a result, IE 6
applies the blue colour and others use red.

Not sure what will happen in KHTML, but I think it should see what Opera
and Gecko see.

For more nice CSS hackism, see:

http://www.goddamn.co.uk/tobyink/sty...umn-layout.css

That file does my two column layout for Opera 3.6+, Internet Explorer 4+,
Gecko and Konqueror 3. I think it's pretty nifty.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
delerious@no.spam.com
Guest
Posts: n/a
 
      12-23-2003
Thanks for the replies, guys.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best css hack / trick to recommend? Kabuki Armadillo HTML 76 06-27-2008 07:47 PM
css hack for ie nicolacantalupo HTML 0 01-21-2008 01:15 PM
css hack for IE: is using the * acceptable windandwaves HTML 7 10-25-2005 09:48 AM
Call Manager Platform Reg Hack R Siffredi Cisco 6 04-13-2005 01:27 PM
Nice CSS rollovers: IE hack altamir HTML 1 11-17-2003 11:08 PM



Advertisments