使HTML5标头与IE工作 - HTML5 Shiv不修复我的布局 [英] Make HTML5 header work with IE — HTML5 Shiv doesn’t fix my layout

查看:87
本文介绍了使HTML5标头与IE工作 - HTML5 Shiv不修复我的布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



今天我发现了我的问题,IE不能像我的HTML5元素那样工作< header> < footer>



当我用< div> 替换它们时,几乎所有的问题都消失了。所以我开始搜索如何添加IE支持这些HTML5功能。



我发现了 Modernizr HTML5 Shiv 也从我读过的,基本的Javascript添加支持,像< header> 是这个...

  document.createElement(header) ; 

现在你可以看到我做了我的研究,我还没有运气。现代人没有工作,所以我尝试了HTML Shiv的技巧,还没有运气,所以然后对Javascript的窍门,也没有运气。



所以请有人告诉我什么我可以做吗?



我的IE版本是8,对不起,我没有网站的实时版本来显示

解决方案

这些脚本会使新的元素在IE中工作,但它们的显示风格仍然缺失。
添加从html5boilerplate.com复制粘贴的以下css:

 文章,旁边的细节,figcaption,figure ,footer,header,hgroup,nav,section {display:block; } 
音频,画布,视频{display:inline-block; *显示:inline; * zoom:1; }
audio:not([controls]){display:none; }
[hidden] {display:none;


I posted the other day about problems I was having with my layout in IE.

Today I figured out my problem, IE was not working for my HTML5 elements like <header> and <footer>

When I replaced them with <div> almost all my problems went away. So I started searching for how to add IE suppot for these HTML5 features.

I came across Modernizr and HTML5 Shiv also from what I read, the basic Javascript to add support for something like <header> is this...

document.createElement("header");

Now you can see I have done my research and I am still not having any luck. Modernizr did not work so then I tried the HTML Shiv trick and still no luck so then on to the Javascript trick and no luck either.

So please can someone tell me what I can do?

My IE version is 8 and sorry I do not have a live version of the site to show

解决方案

Those scripts will make the new elements work in IE but their display style is still missing. Add the following css which I copy pasted from html5boilerplate.com:

article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
[hidden] { display: none; }

这篇关于使HTML5标头与IE工作 - HTML5 Shiv不修复我的布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆