-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE conditional comments to target ie9/ie10 and non-ie browser #1002
Comments
We already had this, but it has been removed in #142 because IE9 is not so bad compared to it's predecessors. |
I think I read in the documentation that there was an issue in having so many conditional statements like this. It's always worth customising these for any particular project, e.g. if you're only targeting IE8+, why bother with IE7 or IE6 tags. If you're targeting IE9+, perhaps swap some of these round. I think there's a limit to the number of conditionals that can be included by default to avoid a compatibility mode icon being presented in the address bar. |
@Aaunel can't you simply avoid triggering compatibility mode with the following meta tag?
Based on that, assuming there's no substantive increase in load times, and it doesn't introduce some other bug, what is the downside to including an additional conditional statement at the top of the document? Even though IE9 is good, there are still things it doesn't do perfectly, and using conditionally-assigned classes instead of browser hacks seems like a good idea. |
ie9 is not that bad. i dont think we need a conditional command for ie9 or ie10. |
@AndrewBrinker short answer: no... A series of cc's forces IE into rendering the page in compatibility mode and ignoring the edge-case in If anything, I think the cc's should be entirely reduced to So...
IE9 seems to be adapting reasonably well so far, and anything that's not supported is handled best using modernizr. |
As I understand it, h5bp is made as a starting point and provides useful tips and optimizations. It needs to be adapted to every project's need and conditional comments were made to make developers' life easier. If h5bp still accounts for ie6, why not account for ie9 specificities? No betrayal there, but the simple recognition that as you say « it's not so bad ». As pointed out in the article cited in #142, ie9 came a long way forward but didn't catch up yet. There are still edge cases and some of them can be adressed without javascript. So the Modernirz approach recommended in #142 isn't convincing. Overall it falls down to performance and conversion. Why add the overload of javascript libraries and polyfills when it can be done with conditional comments + a few lines of css. I mean: http request, load time, processing, DOM modifications... |
the class set with conditional commands should be used to fix bugs in older ie versions. ie9 has fixed most of this bugs so no need for such a class. features not available in IE9 like css-gradients should never be adressed with the help of this class! use modernizers feature detection instead! |
@yogoo if you're already using Modernizr there's no significant additional processing time... there would, however, be additional time involved in writing a CSS workaround, plus potential room for error where your own solution may incur other issues... crowd-source the polyfillers, it's what plugins like Modernizr are available for @lhwparis also, you're spot-on in that I find the conditional comments pretty ugly, but certainly agree that they're the best solution amongst alternatives. |
Makes a lot more sense. Especially the part on conditional comments made for bug correction. Thanks for the explanations. |
Since IE10 doesn't recognize any conditional comments, <!--[if gt IE 9]> actually means the same thing to it as <!--[if !IE]>. So shouldn't it be changed to <!--[if !IE]> now that we know that? Or will that confuse developers who think that means (logically) that it's not going to target IE10? So it's either support the correct way that's confusing, or continue to support the old way that's more logically correct, but is actually meaningless... Leave it to Microsoft to make a statement as simple as [if !IE] not exclude all versions of IE. (I get why they're getting rid of conditional comments; it's just going to be a weird transitional period -- and I can't imagine there won't be SOMETHING we'll still need to detect IE10 for) |
Consider adding a conditional comment to target ie9, ie10 and non ie-browser :
This allows to differentiate ie9 from browsers that offer a better support of html5/css3 (ie10, chrome, FF, safari) and to write rules that should never be applied when the browser is Internet Explorer.
I just needed that on site's form for graceful degradation of the placeholder attribute without using any javascript.
This allows to hide form labels and use placeholder where supported (ie10, chrome, FF, saf.) and to show labels where placeholders are not supported (ie9 and below).
The text was updated successfully, but these errors were encountered: