IE浏览器访问网站提示升级

这两天写一个小程序的时候由于使用了css3.在IE下直接炸了- -。

用了selectivizr.js试了下也解决不了。只能做个提示升级页面了。

代码插入在<head></head>之间

1
2
3
4
5
6
7
8
9
10
11
12
13
<!--[if lte IE 8]>
<div id="ie6-warning"><p>本页面采用HTML5+CSS3,您正在使用老版本 Internet Explorer ,在本页面的显示效果可能有差异。<br>
建议您升级到 <a href="http://www.microsoft.com/china/windows/internet-explorer/" target="_blank">Internet Explorer 9</a> /
<a href="http://www.mozillaonline.com/">Firefox</a> /
<a href="http://www.baidu.com/s?wd=google%E6%B5%8F%E8%A7%88%E5%99%A8">Chrome</a> /
<a href="http://www.apple.com.cn/safari/">Safari</a> /
<a href="http://www.operachina.com/">Opera</a></p></div>
<style type="text/css">
/*ie6提示*/
#ie6-warning{width:100%;background:#ffffe1;padding:5px 0;font-size:16px;font-weight:bolder;text-align: center}
#ie6-warning p{width:960px;margin:0 auto;}
</style>
<![endif]-->

参考来源:http://www.oschina.net/code/snippet_929621_45377


评论区