For open graph, I see several IE specific html tags at the top of several websites (including airbnb, fab, fashiolista), which are like these:

<!--[if lte IE 7]><html class="no-js ie lt-ie10 lt-ie9 ie7" lang="en"><![endif]-->
<!--[if IE 8]><html class="no-js ie lt-ie10 lt-ie9 ie8" lang="en"><![endif]-->
<!--[if IE 9]><html class="no-js ie lt-ie10 ie9" lang="en"><![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" lang="en" ><!--<![endif]-->

I searched those sites but couldn't find any class definitions of ie/ie7/ie8/lt-ie9/no-js/... They don't seem to download any IE-specific stylesheets also.

Can anyone help me in understanding the significance of these classes here?

有帮助吗?

解决方案

The classes (lt-ie9 etc.) help you to style for specific Internet Explorer versions. This means you don't need a separate stylesheet for IE versions.

More info about these conditional comments and how to use them are described by Paul Irish - Conditional Stylesheets vs CSS Hacks? Answer: Neither!.

Also NOTE that IE10 dropped the support for the conditional classes, hence, they are not seen at the top. Ref: http://msdn.microsoft.com/en-us/library/ms537512%28v=VS.85%29.aspx

And HTML5boilerplace is going to drop those conditional classes to not support any of those IE6/7 moving forward (IE8 doesn't need much of hacks, they were the most for IE6 and 7).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top