您的位置:首页 > Web前端 > CSS

IE样式兼容写法

2016-02-03 16:50 483 查看
1、第一种写法

利用<!--[if lt IE 6/7/8/9/10/11]><![endif]-->,给每个html写一个class

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie ie6 lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]><html class="ie ie7 lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><html class="ie ie8 lt-ie9"><![endif]-->
<!--[if gt IE 8]><!--><html><!--<![endif]-->
<head>
...


1、第二种写法

还是利用<!--[if lt IE 6/7/8/9/10/11]><![endif]-->,让dom单独引入样式:

<!--[if lt IE 10 ]>
<link rel="stylesheet" type="text/css" media="all" href="/css/ie-hacks.css" />
<![endif]-->

<!--[if lt IE 10]>
<script src="/js/lib/placeholder-iehack.js"></script>
<![endif]-->
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: