By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,767 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,767 IT Pros & Developers. It's quick & easy.

CSS hack for IE 6?

P: n/a
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.

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
de*******@no.spam.com 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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a
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

Jul 20 '05 #3

P: n/a
Thanks for the replies, guys.

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.