How to Deal with IE 6 after Dropping Support

by Jeff Starr on Monday, September 22, 2008 53 Responses

As announced at IE Death march, I recently dropped support for Internet Explorer 6. As newer versions of Firefox, Opera, and Safari (and others) continue to improve consistency and provide better support for standards-based techniques, having to carry IE 6 along for the ride — for any reason — is painful. Thanks to the techniques described in this article, I am free to completely ignore (figuratively and literally) IE 6 when developing and designing websites. Now that I have dropped support for IE 6, I feel liberated, free of the constraints that once enslaved my time, energy, and resources. Working on my new design, I have already saved countless hours that would have been wasted on IE 6. If you are still chained to an old copy IE 6, I highly recommend kicking it to the curb and experiencing the freedom for yourself. All it takes is a few lines of code and the decision to go there.

For me, the decision to drop IE 6 developed gradually. Years of growing frustration, wasted time, and unsatisfactory workarounds finally reached critical mass a few weeks ago. Working on my new design, I intended to go about business as usual, designing my site to work great in modern browsers, and also look halfway decent (or at least recognizable) in IE 6. As usual, after the first few hours of designing for Firefox, Opera, and Safari, I fired up my trusty, seven-year-old Sony Vaio laptop and opened my fledgling design in good ‘ol Internet Explorer 6. Surprise, surprise, a total nightmare. The CSS rendering was a joke. The layout looked like somebody had put it through a blender. The JavaScript completely failed to work. I sat for a moment, staring at the screen, asking myself if I really wanted to go another ten rounds fighting this atrocious browser.

I didn’t. In fact, I decided then and there to completely kick IE 6 to the curb. Immediately after making that decision, I felt as if a tremendous burden had been lifted off my shoulders. After a pleasant sigh of relief, I quickly dropped a few lines into the <head> section of my new theme:

<!--[if !IE]><!--><link rel="stylesheet" type="text/css" media="screen" href="style.css"><!--<![endif]-->
<!--[if gte IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style.css" /><![endif]-->

These two conditional comments ensure that the stylesheet is delivered to all browsers except IE 6 and below. IE 7, 8 and beyond will receive the stylesheet, and so will every non-IE browser, such as Firefox, Opera, Safari, and so on. This is the easiest way to ensure that your pages remain usable when viewed in Internet Explorer 6. Simply serving your default stylesheet to IE 6 may leave your content unusable, incoherent, or worse. Personally, I would rather deliver a plain (X)HTML document rather than have visitors think I was too incompetent to design a halfway decent web page.

But why stop there? After testing this method in various browsers, I realized that some sort of explanation was required for those die-hards out there still working with IE 6. I certainly don’t want the small percentage of my IE-6 visitors to think that something is broken (other than their browser!) when visiting Perishable Press and seeing the unstyled markup. Instead of that, IE-6 users will receive the following message:

ATTENTION: Perishable Press no longer supports crusty old versions of Internet Explorer. Please upgrade your browser or switch to something better, like Firefox, Opera, or Safari.

To ensure that only users of older versions of IE see the message, I once again turn to conditional comments:

<!--[if lte IE 6]><h3 style="color:red;">ATTENTION: Perishable Press no longer supports crusty old versions of Internet Explorer.<br />Please upgrade your browser or switch to something better, like Firefox, Opera, or Safari.</h3><![endif]-->

With that code placed just below the <body> element on every page, the notice will be unavoidable (yet unobtrusive) to anyone using IE 6 and below. Of course, the site will remain completely usable and accessible even without the stylish interface, but users will be gently inspired to use a better browser. If you are seeking a more urgent method of encouraging your IE-6 audience to “let it go,” I highly recommend Chris Coyier’s controversial IE 6 Blocker Script, which provides an less-subtle JavaScript approach for dealing with IE 6 — and be sure to read through the comment thread of the article for some great commentary, questions, and criticism.

Speaking of JavaScript, if you are going to drop CSS support for Internet Explorer 6, you might as well save the bandwidth and discontinue the JavaScript love as well. Although there are many great ways to enhance a plain (X)HTML page using small snippets of JavaScript, there are many situations where plainly delivered pages don’t require an entire JavaScript library such as jQuery, Prototype, or MooTools. In fact, if the JavaScript is applying CSS styles on the fly, your plainly delivered page may appear strange or altogether broken when rendered in IE 6. For example, if you are using a slider script that dynamically applies CSS to transform the width of a division to some large value, an unwanted horizontal scrollbar will appear when viewing the CSS-less page in IE 6. There are many other examples, but I am sure you get the idea.

Thus, to prevent a JavaScript file from being delivered to IE 6 (and below), we again turn to conditional comments to accomplish the task:

<!--[if !IE]><!--><script src="javascript.js" type="text/javascript"></script><!--<![endif]-->
<!--[if gte IE 7]><script src="javascript.js" type="text/javascript"></script><![endif]-->

With that, all browsers except IE 6 and below will receive the JavaScript file. The conditional-comment technique is great not just for JavaScript and CSS, but for any type of content that needs to be hidden from or targeted to any version of everyone’s favorite browser.

Let’s blow this joint

Since dropping support for Internet Explorer 6, I am one happy camper. My design efforts now stay focused on modern, standards-compliant browsers that behave — for the most part — exactly as expected. No more surprises, headaches, hacks, or time wasted dealing with ancient history. The best part is that freedom from IE 6 requires nothing more than a few lines of code and a decision to go there.

About the author

[ Jeff Starr ]

Jeff Starr is a web developer, graphic designer and content producer with over 10 years of experience and a passion for quality and detail. Jeff is co-author of the book Digging into WordPress and strives to help people be the best they can be on the Web. + Follow Jeff on Twitter and subscribe to Perishable Press for quality web-design content delivered fresh.


53 Responses

Add a comment

[ Gravatar Icon ]

Jeff M#1

Hi Jeff
Actually I’ve spent a good part of the day today browsing your excellent site using IE6.

It’s eminently readable at 1024×768 without CSS, in fact I find the no-style mode preferable for information-rich sites like this.

Just remember there’s still a load of Win 2000 machines out there that can’t go IE7 (and must have IE for corp intranets and such). Their loss, I suppose.

Cheers, a really great resource here. I’ll be back often.

[ Gravatar Icon ]

Michael V.#2

Jeff,

You are just doing this for your personal site right? Don’t you think designers would be taking a huge risk in losing clients by adopting this policy? Then again, think of the creativity and productivity gain by dropping IE6 support. My idea is to form a non-profit group in which all the designers in the world contribute $5 per month to pay Microsoft to take Internet Explorer off the market completely!!

[ Gravatar Icon ]

Jeff Starr#3

Hi Michael, yes, I am dropping support for IE 6 on this site, my other personal sites, and also every site that I design via my design company, Monzilla Media. More specifically, I am no longer providing support for IE6 by default, which is to say that a client must explicitly request support for such service. This way, the only “lost” clients are the ones who aren’t willing to compensate for the extra effort. Of course, whether or not other designers decide to drop support for IE6 is completely up to them.

[ Gravatar Icon ]

Jeff Starr#4

@Jeff: Thanks for the kind words; great to hear you enjoy the site. I am glad that the site is usable (readable) without the stylesheet. I am working on a new design for the site that will feature the same non-CSS usability as the current design. IE6 won’t be supported in terms of CSS, but all site content will be quite usable without.

Also, I hear what you are saying about the many machines out there stuck (for one reason or another) with IE6 (or worse). I think developers, designers, and users have suffered long enough — it’s time to let it go and move on. Growing can be painful, but it’s generally for the best. Besides, checking my stats just now, I see that less than 5% of my visitors are using IE6..

Thanks again for the great feedback — it is greatly appreciated! :)

[ Gravatar Icon ]

Jeff M#5

I’ve felt your pain.

I’ve had it up to here with IE conditionals and star hacks.

Way to go ;)

[ Gravatar Icon ]

Jordan Gray#6

Way to go, Jeff! Unfortunately, I must leave you to hold the banner; many of our customers use IE 6, either for personal reasons or because their IT departments won’t upgrade. Current statistics indicate that over 20% of visitors use that travesty.

Personally, having spent about 10% of today hacking our upcoming site to work in that browser, I cannot wait for the day that upgrade anxiety abates enough to drop support entirely and I only have four browsers to support. (Aside from the obvious three, if someone has made the effort of downloading Opera, they deserve a working web.)

Speaking of browsers, any opinions on Google Chrome?

[ Gravatar Icon ]

H5N1#7

As described in this article you can cause IE6 to crash easely :)
This hack still works and you can iterate any function (or object) you want in javascript just to crash IE6.

This can be an evil solution to an evil browser :)

So visitors cannot say that the site is awful since they cannot see the site :D

[ Gravatar Icon ]

Jeff L#8

I checked your site in IE6 to see how it fared with this method, and was REALLY surprised to see the styles load briefly, before going away.

This is very disconcerting.

I really like this method, but is this a failure of the conditional comments??

I’d be fine doing this if the styles never loaded…but to have them load and then go away doesn’t work for me.

[ Gravatar Icon ]

Mathieu Beausoleil#9

Well, I don’t think everything must be black or white. Supporting IE6 can be easy.

The website do not need to be identical on every browser, the content just need to be available, so I’ll not disable all my Stylesheet just cause I use 1 or 2 PNG-24. I’ll not sacrifice ergonomy & user experience cause I have 1 or 2 little incompatibilities.

For major bug (double margin bug, etc.), I’ll take the time to make it work (may take a total of 5 or 10 minutes on whole site).

I personnaly think that people who using IE6 are s***** but we need to understand that people are not familiar with computer like us.

[ Gravatar Icon ]

Jeff Starr#10

@Jordan: Glad you asked! I embraced Google Chrome with open arms and great enthusiasm about a week or so after it first came out. I was knee-deep in my redesign project, I wanted to make sure everything looked proper in Chrome. After a few weeks of using it for various tasks, I have to say that I like it a lot, but I won’t be switching from Firefox and Safari anytime soon. For everyday surfing, Chrome is perfect — fast, and convenient (with the tab launch panel, et al); for web administration operations, I wasn’t too fond of the inline text functionality (e.g., selecting text, copying & pasting, etc.); and for web-design testing, commenting on blogs, and other moderately intensive tasks, I found Chrome to be just too buggy to be taken seriously at this point. I have JavaScript that isn’t working in Chrome, and there are serious display bugs in (X)HTML textareas: text will disappear, overlap, and worse while trying to leave a comment, for example. Bottom line: the first version of Chrome is very good, but not consistent enough for full-time web use. After a few improvements, however, Chrome will be a serious contender.

[ Gravatar Icon ]

Jeff Starr#11

@H5N1: not a bad idea, really.. ;)

[ Gravatar Icon ]

Trav#12

Just wanted to say: Right on Jeff! I’m probably going to initiate the same change on the sites I can get away with it for… IE6 has run it’s race… time to put that nag to pasture : )

[ Gravatar Icon ]

Jeff Starr#13

@Jeff L: yes, actually you are correct about the flash of styled content in the current theme’s IE6 presentation, but thankfully this theme is not employing the methods described in the article. This theme was actually designed about a year ago, when I was still supporting IE6. I had implemented a stylesheet switcher (sun icon, bottom-right corner of screen) for the contrastedly challenged among us, but just could not for the life of me get it to work in IE6 (hence the flash of styled content). My workaround in that case was to provide links to both of the alternate stylesheets, which persist perfectly once the user manually selects one of them. Until they do, however, the stylesheet-switching JavaScript prevents any default stylesheets from loading properly.

All of that to say this: The methods described in the article provide a clean, consistent, and efficient way of dealing with IE6 after dropping support. These methods are not implemented in this current theme, and will not produce any undesirable flashes of styled content in any browser.

I hope that makes sense — sorry for any confusion, Jeff!

[ Gravatar Icon ]

Jeff Starr#14

@Mathieu Beausoleil: i wish it were always that easy, but in my experience, IE6 requires too much fiddling around, hacks, etc. And not just with CSS either; IE6 is known to choke on simple JavaScript as well. I get what you are saying, and in some cases, throwing down support for misaligned floats or transparent PNGs is not a big deal; however, as newer browsers continue to provide greater support for newer CSS, (X)HTML, and JavaScript, at some point it becomes foolish to try to twist, tweak, and hack old versions of IE to behave without crashing. This isn’t a new concept by any means: we were able to let go of Netscape, and we can let go of IE too..

[ Gravatar Icon ]

Jeff Starr#15

@Trav: amen, brother! :)

[ Gravatar Icon ]

Louis#16

I don’t think the conditionnal comments technic is the best approch here. You are making everyone — including people with up-to-date browsers — download the IE6 adressed HTML.

It’s not deadly to make a Firefox user download 4 lines that he won’t use, but when it comes to SEO, I wouldn’t recommend to have each and every of your pages contain content that is not displayed.

Though, your idea of “no stylesheet at all” is nice. I would keep this part, but would place the warning message using a server-side detection (i.e. using PHP or Apache).

On a more personnal side now: I’ve moved to my own student flat this year, and I’ve been without internet there for quite a while now. It should be fixed this week, as I’ve ordered a box from my favorite provider, but for now, I can only read PP when I’m at my father’s.

Jeff my friend, I miss to read you regularly :(

[ Gravatar Icon ]

Jeff Starr#17

Hi Louis, I agree that the extra few lines of conditional comments adds some extra page weight, but is there a better solution? Server-side detection isn’t foolproof, and also requires additional server resources for every page. As for the SEO pros and cons, I have not read anywhere that conditional comments negatively (or in any way) affect the page in question. Perhaps you know otherwise..?

Your own student flat, eh? Sounds nice, except for the lack of Internet access. Hopefully you will be able to connect soon — your presence is sorely missed! ;)

[ Gravatar Icon ]

Louis#18

Server-side detection isn’t foolproof, and also requires additional server resources for every page.

Well, that’s basically the dilemma here: work a little more on the server side and serve the clients tailored pages, or be lazy and drop them large-size clothes, and let them deal with it.

As for SEO, Google and the big others obviously are able to detect hidden text — hidden by CSS, conditionnal comment, or whatever — so it’s more for the sake of it for me.

I mean, we all love to have <title> tags that precisely and uniquely describe the nature of each page. It also serves SEO, but it’s nice to know we have chosen them wisely.

The same thing apply to the content: it feels nice to know that a page doesn’t contain content that has no reason at all to be delivered.

The techical work to do things well is pretty simple also. If you serve static content — and on a site full of ressources like PP, you definitely should — you would just descriminate the browsers at the Apache level, and serve a IE6 tailored page, or a “modern browsers” tailored page.

If you calculate your page with each request, you can simply add a PHP condition around the stylesheet and the warning.

Aaaah, I can’t wait to have internet up and running at my new home!

[ Gravatar Icon ]

SneakyWho_am_i#19

I don’t do web design for a job, but I am in every spare second writing code, expanding my skills, and just basically trying to learn and create as much as I can.

I’m rarely, if ever, surprised at how my recent pages look in Opera or Safari - in fact I often don’t bother to test. Sometimes I look in IE6 as a joke. When it looks good, I’m surprised. IE7 does a bit better, even though it’s getting pretty old now. IE8 does even better as long as there’s no javascript (mine’s normally unobtrusive anyway)

I suck, I’m an amateur. But I am getting more professional faster and faster since I stopped writing code for IE6.

Remember I’m not paid for it, I’m doing it for kicks.

But.. I’m so upset with IE since stopped writing code for it last year, that as a rule of thumb, I won’t even give code to someone if I think they’re going to test it, look at it, edit it, or roll it up and smoke it with Internet Explorer.

I know ONE person who uses IE6. I’m telling him every day to get off it. If he doesn’t, I seriously don’t think I can be his friend any more.

I laughed when I wrote this. It all sounds quite funny, I’m sure - but I’m dead serious, even while laughing about it just now. See, told you web design was fun.

[ Gravatar Icon ]

Jeff Starr#20

@Louis: I agree that conditional comments could be used inappropriately, such as would be the case if you were deliberately trying to pull some black-hat SEO stuntz, but I disagree that two sentences delivered within a conditional comment to old versions of IE would somehow negatively affect the overall integrity or rank quality of a page.

In fact, even though the conditional comments are only seen explicitly by users of old IE, including the information in the source code of all pages is an excellent way to communicate to other designers and developers (and anyone else who might be checking your source code) your intentions concerning various versions of IE. I see conditional comments (as used in this context) as a positive or at worst neutral part of any given page. It conveys useful information to those who can use it, and hides it everyone else. Further, it’s the browser that processes the code — the user doesn’t have to “deal” with anything.

Beyond these points, I would also point out that every PHP evaluation required by the server consumes additional resources. In terms of performance — which is more important than any perceived negative effects caused by (over)generalized pages — requiring an extra PHP evaluation for every page request is not as efficient as including a few lines of conditional content in the markup.

[ Gravatar Icon ]

H5N1#21

@Louis and Jeff:
The pros and cons of conditional comments.

As Louis said it could seem illogical to force people with updated browser downloading 4 more lines of code.
Yes, it COULD seem.
But think about coding in general.
How we do our best? How we learn?
How we improve our skills?

Yes we do it all by good teachers, by communications, by meeting people and disussing about our works.

But even with COPYNG (call it “inspiration”).

When I see a SOURCE CODE of a page I can find wich solution the author used to solve some issue.

I like it.

If the solution is applied by server side application I have to open the page with several browser to see the code-differences.

Server-side solutions are fastest, nicer and logically better but client-side solution are more “visible”.

Why worry about some few bytes more when someone doesn’t care build up heavy-weight-flashsites?

[ Gravatar Icon ]

Louis#22

@H5N1: because some of us are perfectionists :)

[ Gravatar Icon ]

Louis#23

@Jeff: I tend to thing that bandwidth is more valuable than server ressources these days. Server-side calculations — and browser recognition is quite nothing — are a lot more cheap in terms of performances than having to send the user additionnal bytes to ensure that the display is correct.

If I extend your philosophy, a website viewed on a mobile device may have the same source code as the website viewed on a classic browser, but with some additionnal code (CSS/JS) to ensure that it displays correctly on the smaller screen.

I still think that the server is the right actor for browser discrimination; sending tailored content to each browser.

[ Gravatar Icon ]

Jeff Starr#24

@Louis: I disagree that “bandwidth is more valuable than than server resources.” In my experience, everything boils down to server memory, modules, applications, databases, processing, and so on. Conversely, most web hosts are giving away bandwidth by the truckload! But this is a small point compared to my central criticism against browser sniffing:

Detecting various versions of IE is not as reliable as detecting conditional comments from within various versions of IE.

Until I can find a 100% foolproof script that enables consistent, reliable, and efficient browser detection, I will continue to deliver IE-specific stylesheets, JavaScript, and brief messages via conditional comments and simply let IE work it out. Unlike with browser detection, I have never encountered any inconsistencies with this method.

I don’t understand you, Louis; if you truly are a “perfectionist” as you suggest, why do you sacrifice accuracy and precision for the sake of a “cleaner” method?

[ Gravatar Icon ]

Louis#25

My very bad, I didn’t know that server-side detection was unprecise. I have never used it in fact, so I’m very sad to learn that real world implementation is not usable :(

Thank you for making this clear. What I meant by perfectionnist is that I wouldn’t sleep so well at night if I knew there were “hidden” elements in my pages that target IE users only.

Still, I think bandwith is more important than server ressources. Not for the cost factor, but for the “ethics” of it. Overloading (the word is a little bit too much for our case, but in general) the tubes is a very bad practice. There was some discussion recently on my favourite performance oriented french weblog about the preloading techniques used on streaming websites like Youtube. On average, a Youtube user watch only the first 10 seconds or so, but the website preload the whole video everytime. Some other service even preload it on page loading. All this data parasites the web tubes.

Of course, this argument is a little extreme when speaking of two lines of conditionnal comments… but hey, it’s for the principle :D

[ Gravatar Icon ]

Jeff Starr#26

I should emphasize that it is not so much the various browser-detection scripts themselves that are inaccurate or imprecise, but rather the ability of certain browsers to disguise their user-agent identification. Also, proxy use is at an all-time high, and who knows what you are going to get with all of those browsers. And finally, some browsers/devices may not send the (correct) identification at all, leaving the detection script to “guess” at the identity. I hope that makes sense. I didn’t mean to suggest that the scripts were the problem; they are simply lines of logic doing whatever they are written to do. It’s what happens on the outside that convolutes the process.

You know, I am beginning to enjoy these conversations more and more as time goes on.. ;)

[ Gravatar Icon ]

malcolm coles#27

I’m not sure many sites could drop IE6 support altogether. I was looking at a commercial one the other day that had 75% IE users, of which 1/3 were IE6 - so that’s still 25% of their users.

[ Gravatar Icon ]

Jeff Starr#28

@malcolm: I appreciate that fact, but it shouldn’t stop those in the know (i.e., us) from doing their best to get the word out that it’s game over for our old friend, IE6! Yes, there are still lots of people suffering with that horrible browser, but with the momentum slowly building, they too will soon get the message. The goal here is to educate and ultimately reduce that percentage to virtually zero ;)

[ Gravatar Icon ]

Mark#29

Hey there,

TRUST ME. I’d do ANYTHING to give up ALL support for IE. (Even to the extent of applying code that makes IE6 and below crash :D )

Quick question, could you please explain how the code works?

<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<!--<![endif]-->
<!--[if gte IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
<![endif]-->

I do understand the first part - the not IE part. Downlevel-revealed.
But the second part, the gte IE 7 is downlevel-hidden. How does it deliver the stylesheet to IE 7 and above then?

I might have missed something trivial. :)

Thanks

[ Gravatar Icon ]

Jordan Gray#30

gte IE 7 = “greater than or equal to IE version 7,” I believe.

Does that help? :)

[ Gravatar Icon ]

Jordan Gray#31

(What is it with me and typos writing simple tags?)

[ - fixed! ;) ]

[ Gravatar Icon ]

Mark#32

Actually I do understand the meaning of gte IE 7 per se. What I don’t understand is the use of a downlevel-hidden conditional for it.

<!--[if gte IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
<![endif]-->

Will this not mean that the expression above will actually be hidden (instead of shown) in IE versions 7 and above?

Sorry for the inconvenience, but please clarify. I’m confused like nuts. :D

[ Gravatar Icon ]

Jeff Starr#33

Hi Mark, no problem — it takes awhile to wrap your head around conditional comments (at least it did for me). For the code we are using here, the goal is to hide the stylesheet from IE6 and below. To accomplish this, the first conditional comment is simply saying that we want to show the code (CSS link, in this case) to any non-IE browser. So that takes care of everything except for IE. The second conditional comment then takes care of IE by saying, “show this code only if the version is 7 or greater.” To understand this, consider the following quote from the previously linked article on conditional comments:

As a general rule, comments in code are used to hide content. When a DCC hides content, it is functioning as expected and is referred to as “positive” or “hidden.” For supported versions of Internet Explorer (5 and up), a hidden DCC will display its content only when its [if condition] proves true. If the version of IE does not meet the specified condition, the content remains hidden. Of course, all non-IE browsers will treat the hidden DCC as a regular comment and not display its content.

I hope that helps! Let me know if I may be of any further assistance with this. :)

[ Gravatar Icon ]

Jordan Gray#34

Ah, right! I see. Your confusion is well-placed; basically—as Jeff’s article explains—the word “downlevel” doesn’t actually mean what it sounds like it should mean!

Simply, when Microsoft use the word “downlevel,” they’re not referring to versions of Internet Explorer, but to other browsers. If it’s “downlevel-hidden,” other browsers (e.g. Firefox, Safari) can’t see the content; if it’s “downlevel-revealed,” they can.

The first time I read about conditional comments, I actually threw a quiet fit at the arrogance of it. This was back when IE 7 wasn’t even in beta, and I was a web neophyte who regularly spent 20% of my development time struggling to make Microsoft’s “latest” (i.e. five-year-old) browser display my pages correctly. Calling a measurably superior browser in active development “downlevel” when their own software was holding web development hostage seemed positively perverse!

[ Gravatar Icon ]

Jordan Gray#35

PS: in fairness, I should explain that Microsoft were probably thinking mainly of the very old versions of IE (four and below) when they started using the terminology; to be strictly accurate, I should say that “downlevel” is equivalent to “doesn’t support IE conditional comments.” However, since IE < 4 can be effectively dismissed by nearly all web developers, whether or not a comment is downlevel-hidden or -revealed is primarily of concern to non-IE browsers. I hope you don’t feel I was misleading you, it’s just that I’m getting a little too accustomed to making vast (but helpful) simplifications for my higher-ups!

PPS: Thanks for fixing my XHTML dyslexia, Jeff!

[ Gravatar Icon ]

Mark#36

Ah right. I’m getting a grasp of it now.

Firstly, for IE, DCC’s are supported only in IE gte 5.
Hidden DCC’s (the one without <!-->) are forever hidden in browsers other than IE.
Hidden DCC’s only display (in IE) when [if condition] is true.
Revealed DCC’s display in all browsers unless the [if condition] is false. (?)

Got it. That explains. But it will surely need refreshing when I get back to it. :D

***

So the revealed and hidden pertain to other,i.e. that is, “downlevel” browsers, huh. Nice name there Microsoft.

***

I do web design sort of as a hobby only :( so that makes me mediocrely proficient in HTML and CSS. Although I can work around designing for Wordpress given that I’ve got Sandbox or Starkers or Whiteboard to start with, but not from scratch.

Nevertheless, I understand the IE plight. And I’m part of it. When I see my work in IE with the inexplicable distortions it’s done to it, I stare blankly.

I have yet to learn how to program fixes for IE, but I guess by that time the design community will have completely abandoned consideration for IE6 and below. So maybe I’d rather not, as Jeff said.

Thanks guys! Appreciate it.

[ Gravatar Icon ]

Mark#37

Sorry, markup error there:

Hidden DCC’s, the one without <!-->

[ - Fixed! :) ]

[ Gravatar Icon ]

Mark#38

PS: in fairness, I should explain that Microsoft were probably thinking mainly of the very old versions of IE (four and below) when they started using the terminology; to be strictly accurate, I should say that “downlevel” is equivalent to “doesn’t support IE conditional comments.” However, since IE < 4 can be effectively dismissed by nearly all web developers, whether or not a comment is downlevel-hidden or -revealed is primarily of concern to non-IE browsers.

You didn’t mislead me at all. That is true, indeed. As you said in the aspect of DCC support, as we consider IE lte 4 obsolete, the downlevel comment’s being hidden/revealed inadvertently now affects non-IE browsers.

Doesn’t change my __abounding love__ for IE as a small web designer.

[ Gravatar Icon ]

Jordan Gray#39

Don’t worry, Mark, we’ve all been there! :) You seem to get it now, and CCs are a fairly advanced topic—so if this is your first time hearing about them, my compliments to you for picking the concept up so readily. To summarise:

• Downlevel-hidden don’t display in any browsers except for IE after version five, and then only if they meet the specified condition.

• Downlevel-revealed are the same as downlevel-hidden, except that they are always displayed in non-IE browsers and versions of IE below five.

(I’d have used an actual list, but that’s hardly “simple XHTML,” at least in the context of a blog comment form!)

[ Gravatar Icon ]

Mark#40

Just an aside:

Personally dropping support for IE6 and voicing out IE6 concerns with respect to clients (i.e. charging extra for IE6 compatibility, as Elliot Jay Stocks has sworn to do) is probably one of the little ways professional designers can break through the design-sphere and make the IE plague known to a wider audience: to people who are just surfing the web or paying designers to do the work.

After all, though the hatred for the browser may saturate the design community, the customers and regular people are the ones that maneuver the market share. They’re the majority, and they (as was established) are still sticking to the forsaken browser.

[ Gravatar Icon ]

Jeff Starr#41

Well said, Mark! Here is some news that I find greatly encouraging! (Now, if we could only get Microsoft to share the sentiment!;)

[ Gravatar Icon ]

Mark#42

There we go! That’s the way to do it!

Thanks, Jeff!

[ Gravatar Icon ]

Nicolas Hoizey#43

In your first example, why don’t you only one comment:

<!--[if gte IE 7]><!-->
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<!--<![endif]-->

Isn’t it enough to show the CSS for everyone except IE6 and less?

[ Gravatar Icon ]

Jeff Starr#44

@Nicolas Hoizey: Good thinking, but it won’t validate. When excluding anything other than all IE ( !IE ) for either HTML or XHTML, additional markup is required for validation. This additional markup can get pretty ugly, so I use the extra conditional comment instead. See my article on Downlevel Conditional Comments for more information.

[ Gravatar Icon ]

Azad#45

Well done. I dropped support when I designed my blog. Best decision I ever made.

[ Gravatar Icon ]

Josh#46

Hi jeff,

After reading this I began experimenting with DCC syntax and arrived at the same syntax suggested by Nicolas. I tested it using all major browsers as well as IETester for several older versions of IE. In all tests it produced the preferred results (green text in all browsers except IE Pre-7, and no stray characters), and as you can see by pasting my demo HTML into the W3C Markup Validator, it is said to be valid.

Are you suggesting that there is a reason this is invalid even though the W3C passes it, or perhaps the W3C has since changed the validator for this case?

My syntax for “dropping IE 6 support” without duplication is:

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

Here is my simple demo page in XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
       <head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
              <title>Demo</title>
              <!--[if gte IE 7]><!-->
                     <style type="text/css">
                            <!--
                                   .demo-font { color:green; }
                            -->
                     </style>
              <!--<![endif]-->
       </head>
       <body>
              <p class="demo-font"><strong>test</strong></p>
       </body>
</html>

[ Gravatar Icon ]

Jeff Starr#47

Hi Josh, yes that definitely seems to work.. My original thinking was based on this article:

http://www.webdevout.net/css-hacks#conditional_comments

The logic in that article is also discussed in other online resources; however, it looks like your suggested method is also prevalent on the Web, and seems to be a simpler — and equally valid — way of accomplishing the same thing. Either method will work, but the approach you are using is much more elegant.

Thanks for sharing — I am looking forward to testing this during my next implementation of the technique.

[ Gravatar Icon ]

Davis@chicago web company#48

Well your post covers most of the issues of IE6 but I guess now its no longer the issue as we have the option of downloading the IE8. Thanks anyways.

Trackbacks / Pingbacks
  1. How to Deal with IE 6 at IE Death March
  2. image rotator breaks in IE6 with ... - DIY Themes Forums
  3. Proiectarea unei interfete web: Cum abordam Internet Explorer 6? « Interfete Web
  4. Internet Explorer 6 support discontinued | Web Design
  5. Proiectarea unei interfete web: Cum abordam Internet Explorer 6? | Interfeţe Web
Share your thoughts..

Read Comment Policy

Comment Rules: No spam. No profanity. Use your real name. You may use simple HTML tags for style. Wrap all code in <code> tags. Learn more.



Attention: Do NOT follow this link!