首页 > 其他 > 详细

IE浏览器兼容的处理方式之一,使用特殊的注释 <!--[if IE]> ....<![endif]-->

时间:2019-02-14 14:44:37      阅读:174      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <!--[if IE]>
        <p>这里的代码在IE浏览器中可以执行,但在其他浏览器是不能执行的<p>
        
        
        <![endif]-->


           <!--[if lte IE7]>
           <p>这里的代码在IE7一下浏览器中可以执行,但在其他浏览器是不能执行的<p>
            
            <![endif]-->
</body>
</html>

可以对具体的IE进行兼容,如

[if lte IE7] 其中lte是小于等于的意思,gte是大于等于的意思

IE浏览器兼容的处理方式之一,使用特殊的注释 <!--[if IE]> ....<![endif]-->

原文:https://www.cnblogs.com/yangxiaohui227/p/10374416.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!