bootstrap 兼容哪些浏览器
Bootstrap的目标是在最新的桌面和移动浏览器上有最佳的表现,也就是说,在较老旧的浏览器上可能会导致某些组件表现出的样式有些不同,但是功能是完整的。
bootstrap3支持的浏览器: Chrome (Mac、Windows、iOS和Android)
Safari (只支持Mac和iOS版,Windows版已经基本死掉了)
Firefox (Mac、Windows)
Internet Explorer
Opera (Mac、Windows)
Bootstrap在Chromium、Linux版Chrome、Linux版Firefox和Internet Explorer 7上的表现也是很不错的,只是官方并不提供支持。
Internet Explorer 8 和 9的很多CSS3属性和HTML5元素,例如圆角矩形和投影,不支持。
Internet Explorer 6 几乎不支持,nav, pagination 等在ie6上表现都特别差。
使用bootstrap2的bsie插件 http://www.bootcss.com/p/bsie/ ,提取插件里的 bootstrap-ie6.css 和ie.css,在页面的head里bootstrap.css之下加入如下代码:
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="/css/bootstrap-ie6.css?1">
<![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="/css/ie.css">
<![endif]-->
禁用响应式布局: <link href="/css/non-responsive.css" rel="stylesheet" media="screen"> html里的css代码: <style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
/* 禁用响应式布局:重新设置container的宽度。如果没有后面三行的代码,在IE6环境下navbar-top会显示为940px宽度 */
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width:1140px;
}
</style> 打开 bootstrap-ie6.css文件,将文件里的pager替换为pagination,用于支持bootstrap3的分页组件。并在底部加入如下代码,代码作用请看注释: /* 栅栏系统,溢出的问题 */
.col-xs-1 {
width: 5.7%;
}
.col-xs-2 {
width: 13.96%;
}
.col-xs-3 {
width: 22.2%;
}
.col-xs-4 {
width: 30.5%;
}
.col-xs-5 {
width: 38.8%;
}
.col-xs-6 {
width: 47%;
}
.col-xs-7 {
width: 55.2%;
}
.col-xs-8 {
width: 63.5%;
}
.col-xs-9 {
width: 72%;
}
.col-xs-10 {
width: 80%;
}
.col-xs-11 {
width: 88.3%;
}
.col-xs-12 {
width: 100%;
} /* 修复ie6下分页组件css解析失败的问题 */
.pagination .active a,
.pagination .active span {
z-index: 2;
color: #ffffff;
cursor: default; border-color: #428bca;
} /* 修复ie6下input样式被重写的问题*/
.form-control{
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle; border: 1px solid #cccccc;
border-radius: 4px;
}
在html页body之上添加如下代码: <!--[if lte IE 6]>
<script type="text/javascript" src="/js/bootstrap-ie.js"></script>
<![endif]-->
<script type="text/javascript">
(function ($) {
$(document).ready(function() {
if ($.isFunction($.bootstrapIE6)) $.bootstrapIE6($(document));
});
})(jQuery);
</script> html整个头部文件如下: <!DOCTYPE HTML>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- Bootstrap theme -->
<link href="/css/bootstrap-theme.min.css" rel="stylesheet">
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="/css/bootstrap-ie6.css?1">
<![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="/css/ie.css">
<![endif]-->
<link href="/css/non-responsive.css" rel="stylesheet" media="screen">
<link href="/css/showLoading.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="/js/html5shiv.js"></script>
<script src="/js/respond.min.js"></script>
<![endif]-->
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
/* 禁用响应式布局:重新设置container的宽度。如果没有后面三行的代码,在IE6环境下navbar-top会显示为940px宽度 */
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width:1140px;
}
</style>
bootstrap 兼容哪些浏览器的更多相关文章
- 【转】让Bootstrap 3兼容IE8浏览器
FROM : http://www.ijophy.com/2014/05/bootstrap3-compatible-with-ie8.html 最近在研究Bootstrap(官方,Github)这个 ...
- 让Bootstrap 3兼容IE8浏览器
最近在研究Bootstrap(官方,Github)这个优秀的前端框架,Bootstrap最开始是Twitter团队内部的一个前端框架,所谓前端框架就是一个CSS/HTML框架,框架里面有下拉菜单.按钮 ...
- Bootstrap 3兼容IE8浏览器(转)
Bootstrap是一个响应式的布局,你可以在宽屏电脑.普通电脑,平板电脑,手机上都得到非常优秀的布局体验.这种响应式的布局正是通过CSS3的媒体查询(Media Query)功能实现的,根据不同的分 ...
- Bootstrap 3 兼容 IE8 浏览器
公司新上的项目,前端用的Bootstrap3的框架,但它已经放弃对IE9下的支持了.可IE8还是有着许多用户,不能不照顾到他们,IE7以下的,我只想说,现在什么年代了,要解放思想,与时俱进啊,就不能动 ...
- bootstrap3兼容ie8浏览器
bootstrap3 兼容IE8浏览器 2016-01-22 14:01 442人阅读 评论(0) 收藏 举报 分类: html5(18) 目录(?)[+] 近期在使用bootstrap这 ...
- CSS兼容各浏览器的hack
CSS兼容各浏览器的hack:建议:尽可能的手写代码,可以有效的提高学习效率和深度.浏览器的种类多,麻烦自然也多,主要是各种浏览器对某些属性的渲染效果并不相同,所以有时候需要专门针对特定浏览器或者特定 ...
- 【原】CSS实现背景透明,文字不透明,兼容所有浏览器
11.11是公司成立的日子,16岁啦,我呢3岁半,感谢公司给了这样一个平台,让我得以学习和成长,这里祝愿公司发展越来越好~ 进入主题,每年11月11号是光棍节,产生于校园,本来只是一流传于年轻人的娱乐 ...
- JS获取回车事件(兼容各浏览器)
一.用到onkeydown获取事件动作, 二.用到键盘对应代码keyCode, 三. var event=arguments.callee.caller.arguments[0]||window.ev ...
- CSS实现背景透明,文字不透明,兼容所有浏览器
11.11是公司成立的日子,16岁啦,我呢3岁半,感谢公司给了这样一个平台,让我得以学习和成长,这里祝愿公司发展越来越好~ 进入主题,每年11月11号是光棍节,产生于校园,本来只是一流传于年轻人的娱乐 ...
随机推荐
- 【jQuery】网上看到一个不错的登陆界面
预览截图如下: Html部分代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...
- 跳出框架iframe的操作语句
常用的iframe操作语句 ① 本页面跳转语句: "window.location.href" 或者 "location.href" ② 上一层页面跳转 ...
- GO语言学习 ---nil
nil是什么 相信写过Golang的程序员对下面一段代码是非常非常熟悉的了: if err != nil { // do something.... } 当出现不等于nil的时候,说明出现某些 ...
- angular.js快速入门 hello world
我们整个系列的学习会去写一个简单blog雏形,如果有精力再完善美化. 但是这篇还是要从HelloWorld开始学习. angular.js 文件加载我们选用 bootstrap中文网提供的一个cdn服 ...
- Centos设置静态IP及修改Centos配置文件的方法
通常,如果我们想更改主机地址为静态地址或者更改主机名,需要修改的几个文件包括: /etc/sysconfig/network Centos设置主机名和网络配置 /etc/sysconfig/netwo ...
- Go源代码分析——http.ListenAndServe()是怎样工作的
Go对webserver的编写提供了很好的支持,标准库中提供了net/http包来方便编写server.很多教程和书籍在讲到用Go编写webserver时都会直接教新手用http包写一个最简单的hel ...
- CString转char * ,string
CString头文件#include <afx.h> string头文件#include <string.h> 1.CString转char * CString cstr; c ...
- yii2 关系...
link($name) 会使用..get$name...即有hasmany和hasone... // update lazily loaded related objects if (!$relati ...
- PHP5.4新特性之上传进度支持Upload progress
在PHP5.4版本当中给我们提供了好用的特性,上传进度的支持,我们可以配合Ajax动态获取SESSION当中的上传进度: 在使用这一特性之前,需要现在php.ini文件当中进行相应的设置: 1 2 ...
- SparkStreaming操作Kafka
Kafka为一个分布式的消息队列,spark流操作kafka有两种方式: 一种是利用接收器(receiver)和kafaka的高层API实现. 一种是不利用接收器,直接用kafka底层的API来实现( ...