html5兼容问题

1.html5对于ie9一下的版本不支持,所以我们可以添加(你可以下载至本地):

<!--[if lt IE 9]>
<script src="http://cdn.static.runoob.com/libs/html5shiv/3.7/html5shiv.min.js"></script>
<![endif]-->

 2.音频:audio

  浏览器支持:Internet Explorer 9+, Firefox, Opera, Chrome, 和 Safari 都支持 <audio> 元素.

        注意: Internet Explorer 8 及更早IE版本不支持 <audio> 元素.

  使用: autoplay:自动播放,controls控制器,如果不添加页面中不会显示,source:只要浏览器找到支持的格式就不会继续往下找

  autoplay和controls根据具体情况选一个就可以了

<audio autoplay controls>
    <source src="白小白%20-%20幸运有你.mp3" type="audio/mp3">
    <source src="白小白%20-%20幸运有你.ogg" type="audio/ogg">
    您的浏览器暂不支持媒体格式
</audio>

  在原来的html中我们使用的是  

<embed src="白小白%20-%20幸运有你.mp3" hidden="true">

3.音频:

  几乎同上 poster:预加载,如果不支持视频格式,我们可以放一张图片上去;loop:循环播放,当然还有其他属性

<video autoplay controls width="200" height="200" poster="t1.jpg" loop>
    <source src="test.mp4" type="video/mp4">
    您的浏览器暂不支持媒体格式
</video>

 

 

 

 

 

 

posted on 2018-11-23 18:42  xxcxxc  阅读(171)  评论(0)    收藏  举报