- This topic is empty.
-
AuthorPosts
-
December 16, 2014 at 6:46 am #190931kayutParticipant
Hi Guys,
Which of the following 2 methods is the best approach for using conditional comments for different IE versions:
Method 1
Loading different stylesheets for different version of IE:<link href="main.css" rel="stylesheet" type="text/css">
<!--[if IE 9]> <link href="ie9.css" rel="stylesheet" type="text/css"> <![endif]-->
<!--[if IE 8]> <link href="ie8.css" rel="stylesheet" type="text/css"> <![endif]-->
<!--[if IE 7]> <link href="ie7.css" rel="stylesheet" type="text/css"> <![endif]-->
<!--[if IE 6]> <link href="ie6.css" rel="stylesheet" type="text/css"> <![endif]-->Method 2
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->And then adding your target with the corresponding IE class you want to hack.
Thanks
December 16, 2014 at 7:24 am #190934Paulie_DMemberIt’s entirely up to you. There is no ‘best practice’ …just whatever works for you.
Personally, I’m in favour of the first approach…not that I support IE8 anyway….and I’m moving away from IE9 too.
December 16, 2014 at 12:02 pm #190972TheDocMemberOnly people that would probably ever use a version before IE9 these days are webnerds doing theoretical/archaic experimenting or the rare civil servant that must still revert to XP and is forced to use no other browser for some reason. I wouldn’t bother at all myself…
Completely depends on the client. The majority of projects I have worked on over the past couple of years still see a massive amount of traffic from IE8 (you can blame Vista for that).
For me, it’s definitely Method 2. If you’re coding with progressive enhancement in mind then you shouldn’t need dedicated stylesheets for each IE. I usually just need to make a
lt-ie9
mixin and that’s it..some-element { /* regular styles */ @include lt-ie9 { /* some sort of override for < IE9 */ } }
December 16, 2014 at 12:23 pm #190976theacefesParticipantActually, there were a number of things that IE got right the first time that other browsers did not have. And the other browsers have their disadvantages. Firefox for the longest time had terrible dev tools and web developers relied on a plugin to dev on it. Also, it had a period where it became an ugly memory hog. Chrome took a bit to mature to a point where it was worth using. And remember that not everyone here is a freelancer or has the freedom to develop for the latest and greatest. Some of us work on enterprise software – we have to support whatever browser the IT and clients of a company are using. I’ll take $$ and security over the shiny browser any day.
December 16, 2014 at 4:12 pm #190993AnonymousInactiveI guess some people are stubborn to use a proper browser
Ahem. At work I have no 3G, no wifi, and use a remote desktop with XP and IE8 with no ability to install software. Dropped support for IE8? Fine. I can’t use your site. Image heavy? I can’t scroll down without waiting 20 seconds between repaints.
For most sites, it doesn’t make one iota of difference whether I’m considered. I don’t browse non-work-related sites while at work. But some are mission-critical and it’s frustrating when I can’t access content. For example, the UK poisons information service site is both image-heavy and renders poorly, making it hard to find their phone number.
As in all sectors, know your audience.
December 18, 2014 at 5:26 am #191149kayutParticipantI guess another disadvantage of Method 1 is, creating more HTML requests.
But I really love to know more about the Sass solution of “The Doc”:
.some-element { /* regular styles */ @include lt-ie9 { /* some sort of override for < IE9 */ } }
Do I need to add a class .lt-ie9 to those elements, which need especial treatment for IE 8 and lower?
Or how else does it work?
Thanks
December 29, 2014 at 12:32 pm #191828kayutParticipantIs my question that stupid that no one want to answer it? :-(
December 29, 2014 at 12:44 pm #191830Paulie_DMemberIt’s entirely up to you. There is no ‘best practice’ …just whatever works for you.
December 29, 2014 at 3:43 pm #191841kayutParticipantSure, but I’m talking about my last question about “The Doc” solutiion.
I really love to know more about the Sass solution of “The Doc”:
.some-element { /* regular styles */ @include lt-ie9 { /* some sort of override for < IE9 */ } }
Do I need to add a class .lt-ie9 to those elements, which need especial treatment for IE 8 and lower?
Or how else does it work?
January 5, 2015 at 5:25 am #192210kayutParticipantIn other word if lt-ie9 is a Sass Mixin, how does it look like?
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.