有一个工作示例 here
我已经运行了 Modernizr;我有
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
...在 css 中,但在 IE8 及以下版本中,即使元素正确包装了子元素,样式也没有携带?
谁能告诉我我做错了什么?
谢谢
詹姆斯
最佳答案
据我所知,您没有在源代码中的任何地方包含 modernizr。
我确实注意到您在页面底部有一个缩小的 require.min.js
脚本。如果该脚本正在动态加载 modernizr,它将破坏 HTML5 shiv,因为 document.createElement
需要在旧版本的 IE 中调用 before 使用任何元素在 DOM 中。
Drop the script tags in the of your HTML. For best performance, you should have them follow after your stylesheet references. The reason we recommend placing Modernizr in the head is two-fold: the HTML5 Shiv (that enables HTML5 elements in IE) must execute before the , and if you’re using any of the CSS classes that Modernizr adds, you’ll want to prevent a FOUC.
关于css - css 选择器链中的 html 5 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13372470/