当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Html5shiv not working

问题描述:

I´ve a problem with the html5shiv script. It´s not working in ie8>-

Preview here:

This Script is in Use:

<!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

<![endif]-->

already tested:

<script type="text/javascript">

document.createElement('header')

document.createElement('footer')

document.createElement('main')

document.createElement('section')

document.createElement('nav')

</script>

Load the script in the HEAD - AFTER and BEFORE the styles.

All html5 elements have this standard styles:

(load after both scripts)

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; }

Unfortunately not found any suitable solution on google, stackoverflow and the html5shiv documentation site. Tried all Tipps/Tricks from the answers here. But it´s still not working.

网友答案:

Try using Shivs on bottom or change the location. Sometimes they just conflict with Js.!

网友答案:

Is your stylesheet loading from the current domain, not an off-site CDN or anything like that? If the stylesheet is hosted elsewhere, host it locally on your domain and see if that helps.

分享给朋友:
您可能感兴趣的文章:
随机阅读: