473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Preventing IE6 from loading stylesheet

I just completed a new design for a personal web site. After finishing
the basic CSS stuff and double-checking it in Safari, FF, Opera, et al.,
I put on my war paint and fired up IE7 to figure out what kind of hacks
I'd have to apply. Delightfully, IE7 only needed four or five tweaks
this time around...

But next I opened the test page in my IE6 VM, and it took me a few
seconds to even realize what the heck I was looking at. I could
possibly make it render halfway decently with several hours' work, but
why bother? It's just a crummy personal web page. What I'd like to do
instead is to somehow trick IE6 into not loading any styles whatsoever,
so that the page renders like it would in, e.g., lynx; I have the luxury
of not jumping through hoops for IE6 users here, but I don't feel like
leaving the site non-navigable to them, either.

I know about the <!--[if lte IE 6]>...<![endif]--thing, but what I
want is basically the logical inverse of that, so that I can prevent IE6
from loading any of my CSS to begin with: some relatively stable way of
making an @import directive or an HTML <link rel="stylesheet"... />
visible to everything *but* IE6.

Any suggestions? Thanks in advance...

--
Mark Shroyer, http://markshroyer.com/contact/
I have joined others in blocking Google Groups due to excessive
spam. If you want more people to see your posts, you should use
another means of posting on Usenet. http://improve-usenet.org/
Jun 27 '08 #1
8 2321
* Mark Shroyer wrote in comp.infosystems.www.authoring.stylesheets:
>I know about the <!--[if lte IE 6]>...<![endif]--thing, but what I
want is basically the logical inverse of that, so that I can prevent IE6
from loading any of my CSS to begin with: some relatively stable way of
making an @import directive or an HTML <link rel="stylesheet"... />
visible to everything *but* IE6.
If conditional comments would work for you, I suggest you have a look at
http://msdn2.microsoft.com/en-us/library/ms537512.aspx which should have
the right expression for you.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 27 '08 #2
In article <us*******************************@snap.homestarmy .net>,
Mark Shroyer <us*********@markshroyer.comwrote:
I know about the <!--[if lte IE 6]>...<![endif]--thing, but what I
want is basically the logical inverse of that, so that I can prevent IE6
from loading any of my CSS to begin with: some relatively stable way of
making an @import directive or an HTML <link rel="stylesheet"... />
visible to everything *but* IE6.

I managed to come up with something that works after a little more
fooling around:

<style type="text/css">
@import url('screen.css') screen;
@import url('print.css') print;
</style>
<!--[if IE 7]>
<link rel="stylesheet" href="screen.css" />
<link rel="stylesheet" href="iehack7.css" />
<![endif]-->

It turns out that IE 6 can't understand media specifiers in the context
of an @import directive, so it just ignores the entire directive.
Unfortunately, IE 7 does not understand this either, so it is necessary
to load the screen stylesheet with <linkinside an IE 7 conditional
comment.

I'd still be interested to hear other suggestions, though... or any
takes on whether this is a wise thing to do. (Is there anything else
out there other than pre-7 versions of IE that's likely to choke on
this?)

--
Mark Shroyer, http://markshroyer.com/contact/
I have joined others in blocking Google Groups due to excessive
spam. If you want more people to see your posts, you should use
another means of posting on Usenet. http://improve-usenet.org/
Jun 27 '08 #3
In article
<bb********************************@hive.bjoern.ho ehrmann.de>,
Bjoern Hoehrmann <bj****@hoehrmann.dewrote:
* Mark Shroyer wrote in comp.infosystems.www.authoring.stylesheets:
I know about the <!--[if lte IE 6]>...<![endif]--thing, but what I
want is basically the logical inverse of that, so that I can prevent IE6
from loading any of my CSS to begin with: some relatively stable way of
making an @import directive or an HTML <link rel="stylesheet"... />
visible to everything *but* IE6.

If conditional comments would work for you, I suggest you have a look at
http://msdn2.microsoft.com/en-us/library/ms537512.aspx which should have
the right expression for you.

Thanks for the hint, but that doesn't quite work*... but I probably
should have been more specific with regard to my 'requirements'. While
something like

<![if !(IE 6)]>
<link rel="stylesheet" ... />
<![endif]>

works most places, it is not valid XHTML so I'd like to avoid it. On
the other hand, I don't mind using the other form of conditional
comments (which I mentioned above) because it is valid HTML.

[* Unless there's something else I'm failing to understand...]

--
Mark Shroyer, http://markshroyer.com/contact/
I have joined others in blocking Google Groups due to excessive
spam. If you want more people to see your posts, you should use
another means of posting on Usenet. http://improve-usenet.org/
Jun 27 '08 #4
* Mark Shroyer wrote in comp.infosystems.www.authoring.stylesheets:
>Thanks for the hint, but that doesn't quite work*... but I probably
should have been more specific with regard to my 'requirements'. While
something like

<![if !(IE 6)]>
<link rel="stylesheet" ... />
<![endif]>

works most places, it is not valid XHTML so I'd like to avoid it. On
the other hand, I don't mind using the other form of conditional
comments (which I mentioned above) because it is valid HTML.
You can use the form you are comfortable with, e.g.

<!--[if gt IE 6]>
...
<![endif]-->

would be valid and hidden from Internet Explorer 6.0; using

<!--[if !(IE 6)]>
...
<![endif]-->

would exclude Internet Explorer 6 aswell, but include its predecessors.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 27 '08 #5
In article
<fm********************************@hive.bjoern.ho ehrmann.de>,
Bjoern Hoehrmann <bj****@hoehrmann.dewrote:
* Mark Shroyer wrote in comp.infosystems.www.authoring.stylesheets:
Thanks for the hint, but that doesn't quite work*... but I probably
should have been more specific with regard to my 'requirements'. While
something like

<![if !(IE 6)]>
<link rel="stylesheet" ... />
<![endif]>

works most places, it is not valid XHTML so I'd like to avoid it. On
the other hand, I don't mind using the other form of conditional
comments (which I mentioned above) because it is valid HTML.

You can use the form you are comfortable with, e.g.

<!--[if gt IE 6]>
...
<![endif]-->

Sure it would be hidden from IE 6, but it would be hidden from every
other browser as well.

Thanks for the suggestion, but because conditional comments are a
Microsoft-only extension, this does not resolve the original problem;
this example would only work if the only browsers that one is concerned
about are the different versions of IE.

--
Mark Shroyer, http://markshroyer.com/contact/
I have joined others in blocking Google Groups due to excessive
spam. If you want more people to see your posts, you should use
another means of posting on Usenet. http://improve-usenet.org/
Jun 27 '08 #6
* Mark Shroyer wrote in comp.infosystems.www.authoring.stylesheets:
>Sure it would be hidden from IE 6, but it would be hidden from every
other browser as well.
I see, then you can use the method proposed in the comments there,

<!--[if gt IE 6]><!-->
...
<!--<![endif]-->

Here Validators and other browsers will treat this as two comments
with "..." between them, while Internet Explorer 6 and predecessors
with support for conditional comments will treat it differently.
What they see is probably not "valid HTML" but this is as close as
you will get as far as ease of use is concerned.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 27 '08 #7
In article <us*******************************@snap.homestarmy .net>,
Mark Shroyer <us*********@markshroyer.comwrote:
I just completed a new design for a personal web site. After finishing
the basic CSS stuff and double-checking it in Safari, FF, Opera, et al.,
I put on my war paint and fired up IE7 to figure out what kind of hacks
I'd have to apply. Delightfully, IE7 only needed four or five tweaks
this time around...

But next I opened the test page in my IE6 VM, and it took me a few
seconds to even realize what the heck I was looking at. I could
possibly make it render halfway decently with several hours' work, but
why bother? It's just a crummy personal web page. What I'd like to do
instead is to somehow trick IE6 into not loading any styles whatsoever,
so that the page renders like it would in, e.g., lynx; I have the luxury
of not jumping through hoops for IE6 users here, but I don't feel like
leaving the site non-navigable to them, either.

I know about the <!--[if lte IE 6]>...<![endif]--thing, but what I
want is basically the logical inverse of that, so that I can prevent IE6
from loading any of my CSS to begin with: some relatively stable way of
making an @import directive or an HTML <link rel="stylesheet"... />
visible to everything *but* IE6.

Any suggestions? Thanks in advance...
Why don't you put the war paint back on and take a good look at your
html and css and see what IE6 is having *so* much trouble with. It might
well be that in doing so, you will unearth issues where you should be
simplifying in the first place. There may be an issue we can help you
with and once identified it could be fixed by an over-riding conditional.

This is what I do sometimes: duplicate the main stylesheet and call it
ie#.css or whatever. Get it operating by the usual conditional method
(in the head to link to it, underneath the one for all the other
browsers).

I then fire up IE and start removing huge chunks of the ie#.css to see
if anything horrible happens. You might be surprised how quickly you
will identify the area of concern.

--
dorayme
Jun 27 '08 #8
Mark Shroyer <us*********@markshroyer.comwrote in
news:us*******************************@snap.homest army.net:
In article <us*******************************@snap.homestarmy .net>,
Mark Shroyer <us*********@markshroyer.comwrote:
[snip]
I'd still be interested to hear other suggestions,
[snip]

<!--[if gte IE 7]<!-->

<!--<![endif]-->

--
BootNic Friday April 25, 2008 11:50 AM
Behind every successful woman...is a substantial amount of coffee.
*Stephanie Piro*
Jun 27 '08 #9

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

Similar topics

3
by: Joris Gillis | last post by:
Hi everyone, I have this stylesheet: <?xml version="1.0" encoding="ISO-8859-1" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/>...
3
by: PSERVE | last post by:
Is the a way of preventing popups from other sites while your page is loading? -- Regards Nik http://www.itconsultancy.org
4
by: Adrian MacNair | last post by:
Hi, I created an image gallery which displays 63 images in a slideshow. The problem is that the show was slow because each image loaded one at a time during the show. No problem right? I just...
0
by: Martin Dugeorge | last post by:
Hello all, i've got an XSLT stylesheet containing a XSLT document function with an absolute URI : <xsl:for-each select="document('http://x.y.z/dir/a.xml')/root/element">...</xsl:for-each> ...
1
by: campwes | last post by:
Hey, all! We're having trouble displaying SQL Server data in a web site as XML, using a transform. The query is a simple SELECT statement. When running the query, we get the following error from...
3
by: fbwhite | last post by:
I am having an issue (maybe two issues) in my application regarding a stylesheet not loading and I am getting Javascript Errors. If I clean out a client's temporary internet files and then browse...
1
by: niklang | last post by:
Hi everybody, I have an ASP page that uses the MSXML2.ServerXMLHTTP object to read a stylesheet from IIS as follows: strXSLPath = "http://localhost/ej/ejdetail.xsl.asp" ...
3
by: Leighya | last post by:
Im currently working on this xml file but when i load it to Mozilla, i got an error "Error Loading Stylesheet: Xpath parse failure: invalid variable name" It loads on IE properly. Only with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...
0
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...

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.