473,473 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CSS hack for IE 6?

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
3 13939
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
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
Thanks for the replies, guys.

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Haines Brown | last post by:
I thought I had understood this issue and implemented a work around, but now when I check on IE5, it is not working: ... #IE-hack { margin-left: auto; margin-right: auto; width: 20em;...
3
by: cr88192 | last post by:
for various reasons, I added an imo ugly hack to my xml parser. basically, I wanted the ability to have binary payload within the xml parse trees. this was partly because I came up with a binary...
11
by: Chris Beall | last post by:
Here's the problem: http://pages.prodigy.net/chris_beall/Demo/theproblem.html The page contains inline text, then some additional pairs of text which are floated right and left. (This is a...
2
by: Ing. Rajesh Kumar | last post by:
Hi everybody I have about 50 code behind *.vb files from which i have created a single *.dll file. This single *.dll file and all the *.aspx files i will put on a clients computer. So i just...
5
by: Nmx | last post by:
Hi everyone, I'm writing a patch to a search engine (aspseek http://www.aspseek.org/) compile under gcc 3.4.4 on FC3. At some point, I found this piece of code: -- // Dirty hack to avoid...
0
by: Xah Lee | last post by:
In this article, i explain how the use of bit masks is a hack in many imperative languages. Often, a function will need to take many True/False parameters. For example, suppose i have a function...
12
by: Ivo | last post by:
I am programming forum. Tech is ASP.NET, C# and SQL Server 2005. I want to see is my site safe, have I made some security problems. Can you try to hack my site untill 10-september-2007.:...
7
by: badc0de4 | last post by:
Is this a stupid hack or a clever hack? Is it a "hack" at all? ==================== #include <stdio.h> /* !!HACK!! */ /* no parenthesis on the #define'd expression */ #define...
11
by: howa | last post by:
... width:202px; *width:200px; ... The setting with * only can be read by IE, but I want to know... 1. What is the name of this hack? 2. Is all attribute can be combined with a star so only...
0
by: freehackers | last post by:
FreeHackers Group : Only 6 Steps to get cracked your target password 1- Fill in the E-Mail Cracking order form , to the best of your knowledge “contact us to freehackers.007gmail.com with...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.