I am wondering can we use tags like <aside> with Html5Boilerplate. If yes will it browser compatible? and what other tags we can use without fear of older browsers specially IE7 and IE8

有帮助吗?

解决方案

According to the HTML5BoilerPlate site, it includes Modernizr.

Modernizr is a Javascript library that checks the user's browser for compatibility with various features. It also includes a hack which allows IE6/7/8 to support HTML5 tags.

This hack tells IE that the new HTML5 tags are valid HTML. Without it, IE will ignore these tags. With the hack in place, IE will accept those tags as normal HTML.

But note that this in itself doesn't actually add any new features to IE. Therefore, the new semantic tags like <section> and <nav> are fine, but there still wouldn't be any point using tags which provide new HTML5 functionality such as <video> or <canvas>.

Also note that the hack will obviously only work if the end user has Javascript enabled.

See the Modernizr page for more info on how it works and what it does. See also HTML5Shiv, which is a stand-alone version the same hack.

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