'
[Irl-dean] CSS, Conditional Comments and Using Multiple IE
Joshue O Connor
joshue.oconnor at ncbi.ie
Tue Apr 22 14:13:37 IST 2008
Hi all,
I have already asked Gez and Maura about this but I wonder if anyone
else has come across this problem.
Part 1: I am building a website and I wish to use conditional comments
to serve different CSS files/rule to each browser as needed. I have my
CSS for "good browsers" and then I usually write more as needed with
fixes/variations for IE.
However, with the following code I found problems with getting the < IE
6 rules to display at all.
< IE 6 were instead loading the style sheet 'good_browser.css' (which is
for Mozilla etc and IE 8 where it works happily).
Here is the code, any pointers appreciated but it is pretty OK.
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="../test/css/ie.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="../test/css/ie7.css" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css"
href="../test/css/good_browser.css" />
<![endif]-->
<!--[if !IE]> <-->
<link rel="stylesheet" type="text/css"
href="../test/css/good_browser.css" />
<!--> <![endif]-->
But no matter what I did, it would not work and the good_browser.css
file seemed to consistently be the default for IE 6 and earlier. Then I
came to the following conclusion.
Part 2: I am using Multiple IE and I think I *may* have gotten to the
bottom of the problem. After much digging, there seems to be a problem
correctly using Multiple versions of IE on the same local machine, and
conditional comments. Basically when using conditional comments to serve
different style sheets/rules etc, each browser will actually behave, or
identify itself as the highest numbered version of IE that you have
installed on your local machine.
For example, if you have IE 8 installed on your local machine, (as I
have) even if you open up say IE 6 or IE 5.5 to test how some style
looks etc, they will *still* be served the CSS/rules etc for IE 8 as the
older browser seems to identify itself as the highest numbered version.
Any ideas, solutions appreciated as Multiple IE is great - but it does
need to work *properly* to be of any use for development. [1]
Also if anyone has come across this and there is a patch or similar (or
another way of really running different versions of IE on a local
machine please let me know).
Cheers
Josh
[1] http://tredosoft.com/Multiple_IE
********************************************************************
NOTICE: The information contained in this email and any attachments
is confidential and may be privileged. If you are not the intended
recipient you should not use, disclose, distribute or copy any of
the content of it or of any attachment; you are requested to notify
the sender immediately of your receipt of the email and then to
delete it and any attachments from your system.
NCBI endeavours to ensure that emails and any attachments generated
by its staff are free from viruses or other contaminants. However,
it cannot accept any responsibility for any such which are
transmitted. We therefore recommend you scan all attachments.
Please note that the statements and views expressed in this email
and any attachments are those of the author and do not necessarily
represent the views of NCBI
********************************************************************
More information about the CEUD-ICT
mailing list