I see they are included in the HTML5 Boilerplate but I don't know what They are or why they may be useful. I searched on google but could not find any explanation to what they are search

有帮助吗?

解决方案

They're special classes to help you author conditional styles. For instance, rgba isn't supported in some older versions of Internet Explorer, so you may want to load a .png background image instead:

article {
    background-image: rgba(255, 0, 0, .25);
}

.oldIE article {
    background-image: url( 'faintRed.png' );
}

This is a contrived example, but it illustrates the intent behind these classes. Due to conditional comments around tags like <html>, you can conditionally place a class like .oldIE in the ancestral tree of elements, thus allowing you to create fallbacks for older versions of IE.

Conditional Comments no longer work in IE as of version 10. They're not longer needed given the parity of standards support found between Internet Explorer and other modern browsers.

These conditional classes were removed from the HTML5 Boilerplate in September of 2013.

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