BootStrap在各个浏览器的兼容性怎么样

2025-04-06 16:08:17
推荐回答(2个)
回答1:

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之下加入如下代码:


禁用响应式布局:



html里的css代码:



打开 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;
background-color: #428bca;
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;
background-color: #ffffff;
border: 1px solid #cccccc;
border-radius: 4px;
}
在html页body之上添加如下代码:




html整个头部文件如下:

















回答2:

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之下加入如下代码:


禁用响应式布局:



html里的css代码:



打开 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;
background-color: #428bca;
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;
background-color: #ffffff;
border: 1px solid #cccccc;
border-radius: 4px;
}
在html页body之上添加如下代码:




html整个头部文件如下: