码迷,mamicode.com
首页 > 其他好文 > 详细

bootstrap兼容IE

时间:2017-01-09 13:34:07      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:har   name   type   通过   com   html   java   大于   这一   

这种响应式的布局正是通过CSS3的媒体查询(Media Query)功能实现的,根据不同的分辨率来匹配不同的样式。IE8浏览器并不支持这一优秀的Css3特性,Bootstrap在开发文档中写了如何使用进行兼容IE8,如果想兼容IE6,IE7,可以搜索bsie (bootstrap2)。

http://v2.bootcss.com

1,注意,使用bootstrap最好使用2.0以下的jquery;

2,ie8以下不支持placeholder

<script type="text/javascript" src="js/bootstrap/jquery.placeholder.js"></script>
<script type="text/javascript">
    $(function () {
        $(input, textarea).placeholder();
    });
</script>

 

总结:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
    <meta name="author" content="zhy" />
    <title>ie8</title>
    <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
    <!--[if lte IE 9]>
    <script src=js/bootstrap/respond.min.js"></script>
    <script src=js/bootstrap/html5shiv.min.js"></script>
    <![endif]-->
    <script src="js/bootstrap/jquery-1.12.0.min.js"></script>
    <script src="js/bootstrap/bootstrap.min.js"></script>
</head>
<body>
</body>
</html>

IE判断IE版本的语句:

<!--[if lte IE 6]>
<![endif]-->
IE6及其以下版本可见

<!--[if lte IE 7]>
<![endif]-->
IE7及其以下版本可见

<!--[if IE 6]>
<![endif]-->
只有IE6版本可见

<![if !IE]>
<![endif]>
除了IE以外的版本

<!--[if lt IE 8]>
<![endif]-->
IE8以下的版本可见

<!--[if gte IE 7]>
<![endif]-->
IE7及大于IE7的版本可见

lte:就是Less than or equal to的简写,也就是小于或等于的意思。 
lt : 就是Less than的简写,也就是小于的意思。 
gte: 就是Greater than or equal to的简写,也就是大于或等于的意思。 
gt : 就是Greater than的简写,也就是大于的意思。 
! :  就是不等于的意思,跟javascript里的不等于判断符相同

bootstrap兼容IE

标签:har   name   type   通过   com   html   java   大于   这一   

原文地址:http://www.cnblogs.com/wang715100018066/p/6264579.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!