We help IT Professionals succeed at work.

CSS hack for IE5.5 and IE6 - would like to remove it

jasimon9
jasimon9 asked
on
I would like to remove a hack in our website that we have had in for probably 8 years. This is part of a "clean-up" project that will also get validated HTML and CSS.

The hack is to support IE5.5 and IE6. In looking at our weblogs and Google Analytics, I see that there are still a very small number of hits coming in from such browsers. But I suspect they are not from real users.

In any case, this hack did work for us and made it possible to have our page layouts work on those bad boys.

Here is the CSS:

 
/* min-width hack - http://www.cssplay.co.uk/boxes/minwidth.html*/
/* for all browsers that understand min-width */
/* .width {position:relative; width:100%; min-width:867px;} */
/* change to 1000px to accomodate "Send Feedback" and other things */

.width {position:relative; width:100%; min-width:1000px;}
.container {display:block; color:#000;}

* html .width {border-right:860px solid #fff;}
* html .container {display:inline-block; position:relative; margin-right:-860px;}

#content {
	text-align:left;
}

Open in new window


Here is the relevant HTML:

 
<div class="width">
  <div class="container">
	<div id="content">

Open in new window


These divs are nearly at the top of the body section.

My intent would be first to comment out the CSS, and let it run for a while. If there are no complaints after a month or so, then just remove the divs and the related CSS.

Any comments on why this would be a bad idea, other than "it ain't broke, so don't fix?"
Comment
Watch Question

Top Expert 2013
Commented:
It's not a bad idea.  You are taking a careful approach with monitoring and what you are doing allows you to step back if there is a problem.  There are still a handful of users with ancient browsers, but by now they are aware that most sites have problems for them.  I would add a step.  After you remove the div tags run the code through the w3c validator, even if you still have issues on validation, you can determine if you get any unexpected errors.  

Author

Commented:
As stated in the question, this is part of a larger project which includes an HTML/CSS validation sub-project. There are a number of validation failures, often due to external libraries such as dojo which do not validate properly (at least with the version we are using). But we are also abandoning dojo. So there are a lot of dependencies in this overall project.

Good suggestions though.
If you want to make sure your entire site validates, use conditional style sheets.  That way you can create a style sheet that IE 6 and lower see but no other browsers see it.

You can learn more here:

http://css-tricks.com/132-how-to-create-an-ie-only-stylesheet/

That will allow you to also target IE 7, 8, 9, and there are ways to use it for Safari as well.

So that way all of your stylesheets will validate properly and your browsers will see what they need to.

Author

Commented:
We are already using conditional stylesheets as the preferred "IE hack". A la http://www.positioniseverything.net/articles/cc-plus.html 

However, that is not the question. The question is about the relative frequency of use of these old browsers by real users.
The relative frequency of use of the old browsers by real users depends on the type of website you have and how it is used by your visitors.

In the real world IE 6 is being used by 7.9% of the world's population.  So if you consider it that way then it's very rare, however you have to look at the type of site you have.  

If it's geared towards those in their teens through early 30s, it's likely they'll use Safari, Firefox, or Chrome.

If it's geared toward those in their 40s and up it's likely they'll use some version of IE.

If it's geared toward corporate users - almost any corporation - you are virtually guaranteed they're using IE and it's very likely at least half of the users are using IE 6.

Corporations used to have a lot of applications built specifically for IE 6, and because it costs so much to upgrade them they tend to keep IE 6 around.  While it may not be on all machines, it will be on many machines for many years to come.

What you can do to determine how many of your users are using IE 6 and lower is to use something like Google Analytics, Webalizer, or AWStats and monitor browser versions specifically.  You say you're doing that already but you doubt that those are real users, chances are that they are real users who happen to be in corporate environment or who have an old machine (schools, non profits), or they have automatic updates turned off.

Up until just a couple of months ago my biggest client with over 25,000 employees was still using IE 6 across the organization.  Now about half are using IE 7.  And we're already at IE 10 (beta).  So there are still a lot of people using it, but it's unlikely they're using it at home.

Now, once you monitor your site's results you have to determine if it's a large enough group of your visitors to warrant keeping it in there.

If you only get 10 unique visitors per day, but one is using IE 6 then it's worth keeping.

If you get 10,000 unique visitors per day and have 2% using IE 6 then that's 200 people and it's worth keeping even though it's much less than the 10% above.

No one can tell you definitively that you must get rid of IE 6 because it's a sucky browser and people shouldn't be using it.  While that is indeed the case, there are still plenty of people using it and if your company does B2B then keep it.  If it's a more casual site, then get rid of it.

Since it doesn't hurt to link to a stylesheet for IE 6 and lower why not do it? Consider it the equivalent of having a ramp into a restaurant, you may be catering to one person a week but to that person it makes all the difference in the world.

Author

Commented:
We don't operate in the "real word of 7.9%" as much as we operate in the world of "our customer base" which is under 1%.

We have used awstats since 2006 as well as Google Analytics, so we have good data.

My question is about removing the cruft and hacks which result in excess DOM baggage.  Not about having an extra stylesheet.

I have gone ahead and removed it in a temporary way as I said in the question, run it for a few months and see if we get complaints. Our users a predominantly small business owners, who tend to be relatively new to computers. As such, while not "upgrade fanatics", they tend to have newer machines.

Thus it seems we will not see much backlash from not having the 5.5 and 6.0 support.
It depends how many people that 1% works out to.  As per my response above:

- If you only get 10 unique visitors per day, but one is using IE 6 then it's worth keeping because that's 10% of your audience.

- If you get 10,000 unique visitors per day and have 2% using IE 6 then that's 200 people per day and it's worth keeping even though it's much less than the 10% above.

Author

Commented:
We have to draw the line somewhere. According to your logic, we should be supporting iPhone and Android, as they account for about 5 times the traffic of <=IE6. But we don't support those.

In the mean-time we have removed support for <=IE6. I have yet to hear of a complaint. I suppose I will run this test for three months or so, to see what happens.

It is really a only a matter of retaining two extra nested divs around each page. So probably not too serious of a hit. As you can see from the original question, the magic to support old IE browsers is to have the <div id="wdith"> and <div id="container"> around everything. With the CSS, that provides a "min-width" hack for those browers.

The hack is so old in our system, that it was intended for when we had an 860px min width on the site. We have long ago raised that limit, as you can see from the stylesheet, so I suspect we broke things for old browsers anyways long ago. I used to keep a machine around with IE6, but it has been a while.
True, you do have to draw the line somewhere.  I prefer to code sites so they work in all browsers including mobile or if they can't, then they degrade nicely.  but that isn't always an option with corporations if they aren't willing to upgrade their site.

If you are getting 5% of your traffic from mobile users (and that's more than a few people a day) then I would suggest you create a mobile specific style sheet to cater to those users.  It's not that difficult to do and it makes for a better user experience for what is a very rapidly growing audience.

Since you don't provide a link to the site it's hard to see if the change you made was really all that significant and would create a dramatically negative experience for the IE 6 users.  That said, I agree with your decision to drop the support - especially because it was such a small item.

Though ultimately, since it sounds like your site's code is really old, you should consider recoding the entire thing to bring it up to date.  You have the analytics to support the decision and web design and development costs are complete write offs because they are normal business expenses.

Author

Commented:
I was just thinking today about the clean rewrite from scratch. We are not forced into it, and for budgetary reasons it is definitely not a serious project at this time.

Some of the site is quite old, true, and was written without best practices in CSS. Most of that has been removed however. Yet if price was no object, a clean rewrite "would be nice."

The site is at http://www.rephunter.net if you care to spend time looking at it.
That's understandable - it's not in the budget for most people these days, though do consider redoing the site before the economy rebounds and people start using your site like mad.  Unfortunately in this world, the better it looks the better people think it is and it works.

If you find the right company they can usually work with you to do 50% up front and the remainder over several months.  Makes it a little easier to fit in one's budget.

I can see the age of the site, and it would definitely benefit from a modern makeover - especially considering its content.  But I think you're on the right track taking baby steps for now to fix the little things.

It's a great idea for a site and business, is prime for many new technologies and standards, and would be very ideal as a mobile application.  I imagine budget won't be a concern for long, that type of business is very ideal. :)

Author

Commented:
Points for opinions contributed, which is what I was looking for, more or less.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.