Skip to main content Skip to docs navigation
View on GitHub

Browsers and devices浏览器和设备

Learn about the browsers and devices, from modern to old, that are supported by Bootstrap, including known quirks and bugs for each.了解Bootstrap支持的浏览器和设备,从现代到旧,包括每个浏览器和设备的已知怪癖和bug。

Supported browsers支持的浏览器

Bootstrap supports the latest, stable releases of all major browsers and platforms.Bootstrap支持所有主要浏览器和平台的最新稳定版本

Alternative browsers which use the latest version of WebKit, Blink, or Gecko, whether directly or via the platform’s web view API, are not explicitly supported. 直接或通过平台的web视图API使用最新版本的WebKit、Blink或Gecko的替代浏览器不受明确支持。However, Bootstrap should (in most cases) display and function correctly in these browsers as well. More specific support information is provided below.然而,在大多数情况下,Bootstrap也应该在这些浏览器中正确显示和运行。下面提供了更具体的支持信息。

You can find our supported range of browsers and their versions in our .browserslistrc file:您可以在.browserslistrc文件中找到我们支持的浏览器范围及其版本:

# https://github.com/browserslist/browserslist#readme
>= 0.5%
last 2 major versions
not dead
Chrome >= 60
Firefox >= 60
Firefox ESR
iOS >= 12
Safari >= 12
not Explorer <= 11

We use Autoprefixer to handle intended browser support via CSS prefixes, which uses Browserslist to manage these browser versions. 我们使用Autoprefixer通过CSS前缀处理预期的浏览器支持,它使用Browserslist来管理这些浏览器版本。Consult their documentation for how to integrate these tools into your projects.有关如何将这些工具集成到项目中的信息,请参阅他们的文档。

Mobile devices移动设备

Generally speaking, Bootstrap supports the latest versions of each major platform’s default browsers. 一般来说,Bootstrap支持每个主要平台的默认浏览器的最新版本。Note that proxy browsers (such as Opera Mini, Opera Mobile’s Turbo mode, UC Browser Mini, Amazon Silk) are not supported.请注意,不支持代理浏览器(如Opera Mini、Opera Mobile的Turbo模式、UC浏览器Mini、Amazon Silk)。

Chrome Firefox Safari Android Browser & WebView
Android Supported Supported v6.0+
iOS Supported Supported Supported

Desktop browsers桌面浏览器

Similarly, the latest versions of most desktop browsers are supported.同样,支持大多数桌面浏览器的最新版本。

Chrome Firefox Microsoft Edge Opera Safari
Mac Supported Supported Supported Supported Supported
Windows Supported Supported Supported Supported

For Firefox, in addition to the latest normal stable release, we also support the latest Extended Support Release (ESR) version of Firefox.对于Firefox,除了最新的正常稳定版本外,我们还支持Firefox的最新扩展支持版本(ESR)

Unofficially, Bootstrap should look and behave well enough in Chromium and Chrome for Linux, and Firefox for Linux, though they are not officially supported.非正式地说,Bootstrap程序在Chrome和Chrome for Linux以及Firefox for Linux中的外观和性能应该足够好,尽管它们没有得到官方的支持。

Internet Explorer

Internet Explorer is not supported. 不支持Internet Explorer。If you require Internet Explorer support, please use Bootstrap v4.如果您需要Internet Explorer支持,请使用Bootstrap v4。

Modals and dropdowns on mobile移动设备上的模态和下拉列表

Overflow and scrolling溢出和滚动

Support for overflow: hidden; on the <body> element is quite limited in iOS and Android. <body>元素上支持overflow: hidden;在iOS和Android中非常有限。To that end, when you scroll past the top or bottom of a modal in either of those devices' browsers, the <body> content will begin to scroll. 为此,当您在这些设备的浏览器中滚动浏览模式的顶部或底部时,<body>内容将开始滚动。See Chrome bug #175502 (fixed in Chrome v40) and WebKit bug #153852.请参阅Chrome bug #175502(在Chrome v40中修复)和WebKit bug #153852

iOS text fields and scrollingiOS文本字段和滚动

As of iOS 9.2, while a modal is open, if the initial touch of a scroll gesture is within the boundary of a textual <input> or a <textarea>, the <body> content underneath the modal will be scrolled instead of the modal itself. 从iOS 9.2开始,当模式打开时,如果滚动手势的初始触摸在<input><textarea>的文本范围内,模态框下的<body>内容将被滚动,而不是模态框本身被滚动。See WebKit bug #153856.

The .dropdown-backdrop element isn’t used on iOS in the nav because of the complexity of z-indexing. 由于z索引的复杂性,iOS中的nav上不使用.dropdown-backdrop元素。Thus, to close dropdowns in navbars, you must directly click the dropdown element (or any other element which will fire a click event in iOS).因此,要关闭导航栏中的下拉菜单,必须直接单击下拉菜单元素(或在iOS中触发单击事件的任何其他元素)。

Browser zooming浏览器缩放

Page zooming inevitably presents rendering artifacts in some components, both in Bootstrap and the rest of the web. 页面缩放不可避免地会在某些组件中出现渲染工件,无论是在Bootstrap程序中还是在web的其他部分。Depending on the issue, we may be able to fix it (search first and then open an issue if need be). 根据问题的不同,我们可能能够修复它(首先搜索,然后在需要时打开问题)。However, we tend to ignore these as they often have no direct solution other than hacky workarounds.然而,我们倾向于忽略这些问题,因为它们通常没有直接的解决方案,而只有黑客的变通方法。

Validators验证器

In order to provide the best possible experience to old and buggy browsers, Bootstrap uses CSS browser hacks in several places to target special CSS to certain browser versions in order to work around bugs in the browsers themselves. 为了给老的和有缺陷的浏览器提供最好的体验,Bootstrap在几个地方使用CSS browser hacks,针对特定浏览器版本的特殊CSS,以解决浏览器本身的缺陷。These hacks understandably cause CSS validators to complain that they are invalid. 这些黑客行为导致CSS验证程序抱怨它们无效,这是可以理解的。In a couple places, we also use bleeding-edge CSS features that aren’t yet fully standardized, but these are used purely for progressive enhancement.在一些地方,我们还使用了尚未完全标准化的前沿CSS功能,但这些功能纯粹用于渐进增强。

These validation warnings don’t matter in practice since the non-hacky portion of our CSS does fully validate and the hacky portions don’t interfere with the proper functioning of the non-hacky portion, hence why we deliberately ignore these particular warnings.这些验证警告在实践中并不重要,因为CSS的非黑客部分会完全验证,而黑客部分不会干扰非黑客部分的正常功能,因此我们故意忽略这些特定警告。

Our HTML docs likewise have some trivial and inconsequential HTML validation warnings due to our inclusion of a workaround for a certain Firefox bug.我们的HTML文档同样有一些无关紧要的HTML验证警告,这是因为我们包含了针对某个Firefox bug的解决方案。