Installing bootstrap on windows

Содержание
  1. Download
  2. Compiled CSS and JS
  3. Source files
  4. BootstrapCDN
  5. Package managers
  6. RubyGems
  7. Composer
  8. NuGet
  9. Загрузка
  10. Компилированные CSS и JS
  11. Исходные файлы
  12. Bootstrap CDN
  13. Системы управления пакетами (Хождение по сайтам библиотек, скачивание и распаковка архивов, копирование файлов в проект — всё это заменяется парой команд в терминале)
  14. RubyGems
  15. Composer
  16. NuGet
  17. Загрузка
  18. Компилированные CSS и JS
  19. Исходные файлы
  20. Bootstrap CDN
  21. Системы управления пакетами (Хождение по сайтам библиотек, скачивание и распаковка архивов, копирование файлов в проект — всё это заменяется парой команд в терминале)
  22. RubyGems
  23. Composer
  24. NuGet
  25. Getting started
  26. Download
  27. Bootstrap
  28. Source code
  29. BootstrapCDN
  30. Install with Bower
  31. Install with npm
  32. Install with Composer
  33. Autoprefixer required for Less/Sass
  34. What’s included
  35. jQuery required
  36. Precompiled Bootstrap
  37. Bootstrap source code
  38. Compiling CSS and JavaScript
  39. Installing Grunt
  40. Available Grunt commands
  41. grunt dist (Just compile CSS and JavaScript)
  42. grunt watch (Watch)
  43. grunt test (Run tests)
  44. grunt docs (Build & test the docs assets)
  45. grunt (Build absolutely everything and run tests)
  46. Troubleshooting
  47. Basic template
  48. Examples
  49. Using the framework
  50. Starter template
  51. Bootstrap theme
  52. Grids
  53. Jumbotron
  54. Narrow jumbotron
  55. Navbars in action
  56. Navbar
  57. Static top navbar
  58. Fixed navbar
  59. Custom components
  60. Cover
  61. Carousel
  62. Dashboard
  63. Sign-in page
  64. Justified nav
  65. Sticky footer
  66. Sticky footer with navbar
  67. Experiments
  68. Non-responsive Bootstrap
  69. Off-canvas
  70. Tools
  71. Bootlint
  72. Community
  73. Disabling responsiveness
  74. Steps to disable page responsiveness
  75. Bootstrap template with responsiveness disabled
  76. Migrating from v2.x to v3.x
  77. Browser and device support
  78. Supported browsers
  79. Mobile devices
  80. Desktop browsers
  81. Internet Explorer 8 and 9
  82. Internet Explorer 8 and Respond.js
  83. Respond.js and cross-domain CSS
  84. Respond.js and file://
  85. Respond.js and @import
  86. Internet Explorer 8 and box-sizing
  87. Internet Explorer 8 and @font-face
  88. IE Compatibility modes
  89. Internet Explorer 10 in Windows 8 and Windows Phone 8
  90. Safari percent rounding
  91. Modals, navbars, and virtual keyboards
  92. Overflow and scrolling
  93. iOS text fields and scrolling
  94. Virtual keyboards
  95. Navbar Dropdowns
  96. Browser zooming
  97. Sticky :hover / :focus on mobile
  98. Printing
  99. Android stock browser
  100. Select menus
  101. Validators
  102. Third party support
  103. Box-sizing
  104. Accessibility
  105. Skip navigation
  106. Nested headings
  107. . Subsequent headings should make logical use of
  108. Color contrast
  109. Additional resources
  110. License FAQs
  111. It requires you to:
  112. It permits you to:
  113. It forbids you to:
  114. It does not require you to:
  115. Translations

Download

Download Bootstrap to get the compiled CSS and JavaScript, source code, or include it with your favorite package managers like npm, RubyGems, and more.

Compiled CSS and JS

Download ready-to-use compiled code for Bootstrap v4.0.0 to easily drop into your project, which includes:

  • Compiled and minified CSS bundles (see CSS files comparison)
  • Compiled and minified JavaScript plugins

This doesn’t include documentation, source files, or any optional JavaScript dependencies (jQuery and Popper.js).

Source files

Compile Bootstrap with your own asset pipeline by downloading our source Sass, JavaScript, and documentation files. This option requires some additional tooling:

  • Sass compiler (Libsass or Ruby Sass is supported) for compiling your CSS.
  • Autoprefixer for CSS vendor prefixing

Should you require build tools, they are included for developing Bootstrap and its docs, but they’re likely unsuitable for your own purposes.

BootstrapCDN

Skip the download with BootstrapCDN to deliver cached version of Bootstrap’s compiled CSS and JS to your project.

If you’re using our compiled JavaScript, don’t forget to include CDN versions of jQuery and Popper.js before it.

Package managers

Pull in Bootstrap’s source files into nearly any project with some of the most popular package managers. No matter the package manager, Bootstrap will require a Sass compiler and Autoprefixer for a setup that matches our official compiled versions.

Install Bootstrap in your Node.js powered apps with the npm package:

require(‘bootstrap’) will load all of Bootstrap’s jQuery plugins onto the jQuery object. The bootstrap module itself does not export anything. You can manually load Bootstrap’s jQuery plugins individually by loading the /js/*.js files under the package’s top-level directory.

Bootstrap’s package.json contains some additional metadata under the following keys:

  • sass — path to Bootstrap’s main Sass source file
  • style — path to Bootstrap’s non-minified CSS that’s been precompiled using the default settings (no customization)

RubyGems

Install Bootstrap in your Ruby apps using Bundler (recommended) and RubyGems by adding the following line to your Gemfile :

Alternatively, if you’re not using Bundler, you can install the gem by running this command:

Composer

You can also install and manage Bootstrap’s Sass and JavaScript using Composer:

NuGet

If you develop in .NET, you can also install and manage Bootstrap’s CSS or Sass and JavaScript using NuGet:

Загрузка

Загрузите Bootstrap, чтобы получить скомпилированный CSS и JavaScript исходный код или включите его с вашими любимыми менеджерами пакетов, такими как npm, Bower, RubyGems и другие.

Компилированные CSS и JS

Загружайте компилированный, готовый к использованию код Bootstrap v4.3.1 (для легкого внедрения в ваш проект), включающие:

  • Компилированные и «облегченные» бандлы (Смотрите Сравнение файлов CSS)
  • Компилированные и «облегченные» плагины JS.

Сюда не входит документация, исходники или сторонние JS-«зависимости» Зависимости передаются (внедряются) сервису в момент его создания (jQuery или Popper.js). Зависимости передаются (внедряются) сервису в момент его создания.

Исходные файлы

Компилируйте Bootstrap со своим «файлопроводом», загружая наши исходники Sass, JS и файлы документации. Это потребует некоторого дополнительного инструментария:

  • Компилятор Sass (поддерживаются: Libsass или Ruby Sass) для компиляции ваших CSS.
  • Постпроцессоры для создания своих нестандартных свойств CSS. (-webkit-, -moz-, -o-, и т.д.)

Инструменты сборки также могут понадобиться при работе с Bootstrap, но все-таки они не совсем подходят для ваших целей.

Bootstrap CDN

Пропустите загрузку с помощью BootstrapCDN, чтобы получить кэшированную версию скомпилированных в Bootstrap файлов CSS и JS для «облегчения» страницы и ускорения загрузки.

Если вы пользуетесь нашим компилированным JS, не забудьте подключить наши CDN версии jQuery и Popper.js перед вашими JS-файлами.

Системы управления пакетами (Хождение по сайтам библиотек, скачивание и распаковка архивов, копирование файлов в проект — всё это заменяется парой команд в терминале)

Используйте исходники Bootstrap в любом проекте с помощью популярных систем управления пакетами. С любой системой управления пакетами Bootstrap потребует компилятор Sass (препроцессор) и постпроцессор для правильной установки наших компилированных версий.

Устанавливайте Bootstrap в вашем приложении на движке Node с помощью пакета npm:

require(‘bootstrap’) ) загрузит все плагины JS Bootstrap в объект jQuery. Модуль bootstrap сам не экспортирует ничего. Вы можете вручную загрузить плагины JS Bootstrap, загружая файлы /js/*.js в корневую папку пакета.

пакет.json Bootstrap содержит некоторые дополнительные метаданные со следующими ключами:

  • sass — путь к главным исходникам Sass Bootstrap
  • style — путь к полной версии CSS Bootstrap, которая предварительно откомпилирована с помощью установок по умолчанию (без настройки)

Установите Bootstrap в свои приложения на Node.js с пакетом yarn:

RubyGems

Устанавливайте Bootstrap в ваши приложения на Ruby с помощью Bundler (рекомендовано) и системы управления пакетами «RubyGems», просто добавив следующую строку в ваш Gemfile :

Еще один способ – если вы не используете Bundler, вы можете установить gem-файл такой командой:

Composer

Вы также можете устанавливать и управлять Sass и JS в Bootstrap c помощью пакетного менеджера уровня приложений для языка программирования PHP:

NuGet

Если вы занимаетесь разработкой в .NET, вы также можете устанавливать и управлять базами CSS, Sass и JS в вашем Bootstrap с помощью NuGet:

Загрузка

Загрузите Bootstrap, чтобы получить скомпилированный CSS и JavaScript исходный код или включите его с вашими любимыми менеджерами пакетов, такими как npm, Bower, RubyGems и другие.

Компилированные CSS и JS

Загружайте компилированный, готовый к использованию код Bootstrap v4.1.3 (для легкого внедрения в ваш проект), включающие:

  • Компилированные и «облегченные» бандлы (Смотрите Сравнение файлов CSS)
  • Компилированные и «облегченные» плагины JS.

Сюда не входит документация, исходники или сторонние JS-«зависимости» Зависимости передаются (внедряются) сервису в момент его создания (jQuery или Popper.js). Зависимости передаются (внедряются) сервису в момент его создания.

Исходные файлы

Компилируйте Bootstrap со своим «файлопроводом», загружая наши исходники Sass, JS и файлы документации. Это потребует некоторого дополнительного инструментария:

  • Компилятор Sass (поддерживаются: Libsass или Ruby Sass) для компиляции ваших CSS.
  • Постпроцессоры для создания своих нестандартных свойств CSS. (-webkit-, -moz-, -o-, и т.д.)

Инструменты сборки также могут понадобиться при работе с Bootstrap, но все-таки они не совсем подходят для ваших целей.

Bootstrap CDN

Пользуйтесь кэшированной версией Bootstrap для «облегчения» страницы и ускорения загрузки.

Если вы пользуетесь нашим компилированным JS, не забудьте подключить наши CDN версии jQuery и Popper.js перед вашими JS-файлами.

Системы управления пакетами (Хождение по сайтам библиотек, скачивание и распаковка архивов, копирование файлов в проект — всё это заменяется парой команд в терминале)

Используйте исходники Bootstrap в любом проекте с помощью популярных систем управления пакетами. С любой системой управления пакетами Bootstrap потребует компилятор Sass (препроцессор) и постпроцессор для правильной установки наших компилированных версий.

Читайте также:  При установке драйвера видеокарты не загружается windows

Устанавливайте Bootstrap в вашем приложении на движке Node с помощью пакета npm:

require(‘bootstrap’) ) загрузит все плагины JS Bootstrap в объект jQuery. Модуль bootstrap сам не экспортирует ничего. Вы можете вручную загрузить плагины JS Bootstrap, загружая файлы /js/*.js в корневую папку пакета.

пакет.json Bootstrap содержит некоторые дополнительные метаданные со следующими ключами:

  • sass — путь к главным исходникам Sass Bootstrap
  • style — путь к полной версии CSS Bootstrap, которая предварительно откомпилирована с помощью установок по умолчанию (без настройки)

RubyGems

Устанавливайте Bootstrap в ваши приложения на Ruby с помощью Bundler (рекомендовано) и системы управления пакетами «RubyGems», просто добавив следующую строку в ваш Gemfile :

Еще один способ – если вы не используете Bundler, вы можете установить gem-файл такой командой:

Composer

Вы также можете устанавливать и управлять Sass и JS в Bootstrap c помощью пакетного менеджера уровня приложений для языка программирования PHP:

NuGet

Если вы занимаетесь разработкой в .NET, вы также можете устанавливать и управлять базами CSS, Sass и JS в вашем Bootstrap с помощью NuGet:

Getting started

An overview of Bootstrap, how to download and use, basic templates and examples, and more.

Download

Bootstrap (currently v3.4.1) has a few easy ways to quickly get started, each one appealing to a different skill level and use case. Read through to see what suits your particular needs.

Bootstrap

Compiled and minified CSS, JavaScript, and fonts. No docs or original source files are included.

Source code

Source Less, JavaScript, and font files, along with our docs. Requires a Less compiler and some setup.

Bootstrap ported from Less to Sass for easy inclusion in Rails, Compass, or Sass-only projects.

BootstrapCDN

The folks over at StackPath graciously provide CDN support for Bootstrap’s CSS and JavaScript. Just use these BootstrapCDN links.

Install with Bower

You can also install and manage Bootstrap’s Less, CSS, JavaScript, and fonts using Bower:

Install with npm

You can also install Bootstrap using npm:

require(‘bootstrap’) will load all of Bootstrap’s jQuery plugins onto the jQuery object. The bootstrap module itself does not export anything. You can manually load Bootstrap’s jQuery plugins individually by loading the /js/*.js files under the package’s top-level directory.

Bootstrap’s package.json contains some additional metadata under the following keys:

  • less — path to Bootstrap’s main Less source file
  • style — path to Bootstrap’s non-minified CSS that’s been precompiled using the default settings (no customization)

Install with Composer

You can also install and manage Bootstrap’s Less, CSS, JavaScript, and fonts using Composer:

Autoprefixer required for Less/Sass

Bootstrap uses Autoprefixer to deal with CSS vendor prefixes. If you’re compiling Bootstrap from its Less/Sass source and not using our Gruntfile, you’ll need to integrate Autoprefixer into your build process yourself. If you’re using precompiled Bootstrap or using our Gruntfile, you don’t need to worry about this because Autoprefixer is already integrated into our Gruntfile.

What’s included

Bootstrap is downloadable in two forms, within which you’ll find the following directories and files, logically grouping common resources and providing both compiled and minified variations.

jQuery required

Please note that all JavaScript plugins require jQuery to be included, as shown in the starter template. Consult our bower.json to see which versions of jQuery are supported.

Precompiled Bootstrap

Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You’ll see something like this:

This is the most basic form of Bootstrap: precompiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS ( bootstrap.* ), as well as compiled and minified CSS and JS ( bootstrap.min.* ). CSS source maps ( bootstrap.*.map ) are available for use with certain browsers’ developer tools. Fonts from Glyphicons are included, as is the optional Bootstrap theme.

Bootstrap source code

The Bootstrap source code download includes the precompiled CSS, JavaScript, and font assets, along with source Less, JavaScript, and documentation. More specifically, it includes the following and more:

The less/ , js/ , and fonts/ are the source code for our CSS, JS, and icon fonts (respectively). The dist/ folder includes everything listed in the precompiled download section above. The docs/ folder includes the source code for our documentation, and examples/ of Bootstrap usage. Beyond that, any other included file provides support for packages, license information, and development.

Compiling CSS and JavaScript

Bootstrap uses Grunt for its build system, with convenient methods for working with the framework. It’s how we compile our code, run tests, and more.

Installing Grunt

To install Grunt, you must first download and install node.js (which includes npm). npm stands for node packaged modules and is a way to manage development dependencies through node.js.

Then, from the command line:

  1. Install grunt-cli globally with npm install -g grunt-cli .
  2. Navigate to the root /bootstrap/ directory, then run npm install . npm will look at the package.json file and automatically install the necessary local dependencies listed there.

When completed, you’ll be able to run the various Grunt commands provided from the command line.

Available Grunt commands

grunt dist (Just compile CSS and JavaScript)

Regenerates the /dist/ directory with compiled and minified CSS and JavaScript files. As a Bootstrap user, this is normally the command you want.

grunt watch (Watch)

Watches the Less source files and automatically recompiles them to CSS whenever you save a change.

grunt test (Run tests)

Runs JSHint and runs the QUnit tests in real browsers thanks to Karma.

grunt docs (Build & test the docs assets)

Builds and tests CSS, JavaScript, and other assets which are used when running the documentation locally via bundle exec jekyll serve .

grunt (Build absolutely everything and run tests)

Compiles and minifies CSS and JavaScript, builds the documentation website, runs the HTML5 validator against the docs, regenerates the Customizer assets, and more. Requires Jekyll. Usually only necessary if you’re hacking on Bootstrap itself.

Troubleshooting

Should you encounter problems with installing dependencies or running Grunt commands, first delete the /node_modules/ directory generated by npm. Then, rerun npm install .

Basic template

Start with this basic HTML template, or modify these examples. We hope you’ll customize our templates and examples, adapting them to suit your needs.

Copy the HTML below to begin working with a minimal Bootstrap document.

Examples

Build on the basic template above with Bootstrap’s many components. We encourage you to customize and adapt Bootstrap to suit your individual project’s needs.

Get the source code for every example below by downloading the Bootstrap repository. Examples can be found in the docs/examples/ directory.

Using the framework

Starter template

Nothing but the basics: compiled CSS and JavaScript along with a container.

Bootstrap theme

Load the optional Bootstrap theme for a visually enhanced experience.

Grids

Multiple examples of grid layouts with all four tiers, nesting, and more.

Jumbotron

Build around the jumbotron with a navbar and some basic grid columns.

Narrow jumbotron

Build a more custom page by narrowing the default container and jumbotron.

Super basic template that includes the navbar along with some additional content.

Static top navbar

Super basic template with a static top navbar along with some additional content.

Fixed navbar

Super basic template with a fixed top navbar along with some additional content.

Custom components

Cover

A one-page template for building simple and beautiful home pages.

Customize the navbar and carousel, then add some new components.

Simple two-column blog layout with custom navigation, header, and type.

Dashboard

Basic structure for an admin dashboard with fixed sidebar and navbar.

Sign-in page

Custom form layout and design for a simple sign in form.

Justified nav

Create a custom navbar with justified links. Heads up! Not too Safari friendly.

Attach a footer to the bottom of the viewport when the content is shorter than it.

Attach a footer to the bottom of the viewport with a fixed navbar at the top.

Experiments

Non-responsive Bootstrap

Easily disable the responsiveness of Bootstrap per our docs.

Off-canvas

Build a toggleable off-canvas navigation menu for use with Bootstrap.

Tools

Bootlint

Bootlint is the official Bootstrap HTML linter tool. It automatically checks for several common HTML mistakes in webpages that are using Bootstrap in a fairly «vanilla» way. Vanilla Bootstrap’s components/widgets require their parts of the DOM to conform to certain structures. Bootlint checks that instances of Bootstrap components have correctly-structured HTML. Consider adding Bootlint to your Bootstrap web development toolchain so that none of the common mistakes slow down your project’s development.

Читайте также:  Что такое закрытый открытый линукс

Community

Stay up to date on the development of Bootstrap and reach out to the community with these helpful resources.

  • Read and subscribe to The Official Bootstrap Blog.
  • Chat with fellow Bootstrappers using IRC in the irc.freenode.net server, in the ##bootstrap channel.
  • For help using Bootstrap, ask on StackOverflow using the tag twitter-bootstrap-3 .
  • Developers should use the keyword bootstrap on packages which modify or add to the functionality of Bootstrap when distributing through npm or similar delivery mechanisms for maximum discoverability.
  • Find inspiring examples of people building with Bootstrap at the Bootstrap Expo.

You can also follow @getbootstrap on Twitter for the latest gossip and awesome music videos.

Disabling responsiveness

Bootstrap automatically adapts your pages for various screen sizes. Here’s how to disable this feature so your page works like this non-responsive example.

Steps to disable page responsiveness

  1. Omit the viewport mentioned in the CSS docs
  2. Override the width on the .container for each grid tier with a single width, for example width: 970px !important; Be sure that this comes after the default Bootstrap CSS. You can optionally avoid the !important with media queries or some selector-fu.
  3. If using navbars, remove all navbar collapsing and expanding behavior.
  4. For grid layouts, use .col-xs-* classes in addition to, or in place of, the medium/large ones. Don’t worry, the extra-small device grid scales to all resolutions.

You’ll still need Respond.js for IE8 (since our media queries are still there and need to be processed). This disables the «mobile site» aspects of Bootstrap.

Bootstrap template with responsiveness disabled

We’ve applied these steps to an example. Read its source code to see the specific changes implemented.

Migrating from v2.x to v3.x

Looking to migrate from an older version of Bootstrap to v3.x? Check out our migration guide.

Browser and device support

Bootstrap is built to work best in the latest desktop and mobile browsers, meaning older browsers might display differently styled, though fully functional, renderings of certain components.

Supported browsers

Specifically, we support the latest versions of the following browsers and platforms.

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. However, Bootstrap should (in most cases) display and function correctly in these browsers as well. More specific support information is provided below.

Mobile devices

Generally speaking, Bootstrap supports the latest versions of each major platform’s default browsers. Note that proxy browsers (such as Opera Mini, Opera Mobile’s Turbo mode, UC Browser Mini, Amazon Silk) are not supported.

Chrome Firefox Safari
Android Supported Supported N/A
iOS Supported Supported Supported

Desktop browsers

Similarly, the latest versions of most desktop browsers are supported.

Chrome Firefox Internet Explorer Opera Safari
Mac Supported Supported N/A Supported Supported
Windows Supported Supported Supported Supported Not supported

On Windows, we support Internet Explorer 8-11.

For Firefox, in addition to the latest normal stable release, we also support the latest Extended Support Release (ESR) version of Firefox.

Unofficially, Bootstrap should look and behave well enough in Chromium and Chrome for Linux, Firefox for Linux, and Internet Explorer 7, as well as Microsoft Edge, though they are not officially supported.

For a list of some of the browser bugs that Bootstrap has to grapple with, see our Wall of browser bugs.

Internet Explorer 8 and 9

Internet Explorer 8 and 9 are also supported, however, please be aware that some CSS3 properties and HTML5 elements are not fully supported by these browsers. In addition, Internet Explorer 8 requires the use of Respond.js to enable media query support.

Feature Internet Explorer 8 Internet Explorer 9
border-radius Not supported Supported
box-shadow Not supported Supported
transform Not supported Supported, with -ms prefix
transition Not supported
placeholder Not supported

Visit Can I use. for details on browser support of CSS3 and HTML5 features.

Internet Explorer 8 and Respond.js

Beware of the following caveats when using Respond.js in your development and production environments for Internet Explorer 8.

Respond.js and cross-domain CSS

Using Respond.js with CSS hosted on a different (sub)domain (for example, on a CDN) requires some additional setup. See the Respond.js docs for details.

Respond.js and file://

Due to browser security rules, Respond.js doesn’t work with pages viewed via the file:// protocol (like when opening a local HTML file). To test responsive features in IE8, view your pages over HTTP(S). See the Respond.js docs for details.

Respond.js and @import

Respond.js doesn’t work with CSS that’s referenced via @import . In particular, some Drupal configurations are known to use @import . See the Respond.js docs for details.

Internet Explorer 8 and box-sizing

IE8 does not fully support box-sizing: border-box; when combined with min-width , max-width , min-height , or max-height . For that reason, as of v3.0.1, we no longer use max-width on .container s.

Internet Explorer 8 and @font-face

IE8 has some issues with @font-face when combined with :before . Bootstrap uses that combination with its Glyphicons. If a page is cached, and loaded without the mouse over the window (i.e. hit the refresh button or load something in an iframe) then the page gets rendered before the font loads. Hovering over the page (body) will show some of the icons and hovering over the remaining icons will show those as well. See issue #13863 for details.

IE Compatibility modes

Bootstrap is not supported in the old Internet Explorer compatibility modes. To be sure you’re using the latest rendering mode for IE, consider including the appropriate tag in your pages:

Confirm the document mode by opening the debugging tools: press F12 and check the «Document Mode».

This tag is included in all of Bootstrap’s documentation and examples to ensure the best rendering possible in each supported version of Internet Explorer.

Internet Explorer 10 in Windows 8 and Windows Phone 8

Internet Explorer 10 doesn’t differentiate device width from viewport width, and thus doesn’t properly apply the media queries in Bootstrap’s CSS. Normally you’d just add a quick snippet of CSS to fix this:

However, this doesn’t work for devices running Windows Phone 8 versions older than Update 3 (a.k.a. GDR3), as it causes such devices to show a mostly desktop view instead of narrow «phone» view. To address this, you’ll need to include the following CSS and JavaScript to work around the bug.

For more information and usage guidelines, read Windows Phone 8 and Device-Width.

As a heads up, we include this in all of Bootstrap’s documentation and examples as a demonstration.

Safari percent rounding

The rendering engine of versions of Safari prior to v7.1 for OS X and Safari for iOS v8.0 had some trouble with the number of decimal places used in our .col-*-1 grid classes. So if you had 12 individual grid columns, you’d notice that they came up short compared to other rows of columns. Besides upgrading Safari/iOS, you have some options for workarounds:

  • Add .pull-right to your last grid column to get the hard-right alignment
  • Tweak your percentages manually to get the perfect rounding for Safari (more difficult than the first option)

Modals, navbars, and virtual keyboards

Overflow and scrolling

Support for overflow: hidden on the element is quite limited in iOS and Android. To that end, when you scroll past the top or bottom of a modal in either of those devices’ browsers, the content will begin to scroll. See Chrome bug #175502 (fixed in Chrome v40) and WebKit bug #153852.

iOS text fields and scrolling

As of iOS 9.3, while a modal is open, if the initial touch of a scroll gesture is within the boundary of a textual or a

, the content underneath the modal will be scrolled instead of the modal itself. See WebKit bug #153856.

Virtual keyboards

Also, note that if you’re using a fixed navbar or using inputs within a modal, iOS has a rendering bug that doesn’t update the position of fixed elements when the virtual keyboard is triggered. A few workarounds for this include transforming your elements to position: absolute or invoking a timer on focus to try to correct the positioning manually. This is not handled by Bootstrap, so it is up to you to decide which solution is best for your application.

The .dropdown-backdrop element isn’t used on iOS in the nav because of the complexity of z-indexing. 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).

Browser zooming

Page zooming inevitably presents rendering artifacts in some components, both in Bootstrap and the rest of the 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.

Sticky :hover / :focus on mobile

Even though real hovering isn’t possible on most touchscreens, most mobile browsers emulate hovering support and make :hover «sticky». In other words, :hover styles start applying after tapping an element and only stop applying after the user taps some other element. This can cause Bootstrap’s :hover states to become undesirably «stuck» on such browsers. Some mobile browsers also make :focus similarly sticky. There is currently no simple workaround for these issues other than removing such styles entirely.

Printing

Even in some modern browsers, printing can be quirky.

In particular, as of Chrome v32 and regardless of margin settings, Chrome uses a viewport width significantly narrower than the physical paper size when resolving media queries while printing a webpage. This can result in Bootstrap’s extra-small grid being unexpectedly activated when printing. See issue #12078 and Chrome bug #273306 for some details. Suggested workarounds:

  • Embrace the extra-small grid and make sure your page looks acceptable under it.
  • Customize the values of the @screen-* Less variables so that your printer paper is considered larger than extra-small.
  • Add custom media queries to change the grid size breakpoints for print media only.

Also, as of Safari v8.0, fixed-width .container s can cause Safari to use an unusually small font size when printing. See #14868 and WebKit bug #138192 for more details. One potential workaround for this is adding the following CSS:

Android stock browser

Out of the box, Android 4.1 (and even some newer releases apparently) ship with the Browser app as the default web browser of choice (as opposed to Chrome). Unfortunately, the Browser app has lots of bugs and inconsistencies with CSS in general.

Select menus

On elements, the Android stock browser will not display the side controls if there is a border-radius and/or border applied. (See this StackOverflow question for details.) Use the snippet of code below to remove the offending CSS and render the as an unstyled element on the Android stock browser. The user agent sniffing avoids interference with Chrome, Safari, and Mozilla browsers.

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. These hacks understandably cause CSS validators to complain that they are invalid. 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.

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.

Our HTML docs likewise have some trivial and inconsequential HTML validation warnings due to our inclusion of a workaround for a certain Firefox bug.

Third party support

While we don’t officially support any third party plugins or add-ons, we do offer some useful advice to help avoid potential issues in your projects.

Box-sizing

Some third party software, including Google Maps and Google Custom Search Engine, conflict with Bootstrap due to * < box-sizing: border-box; >, a rule which makes it so padding does not affect the final computed width of an element. Learn more about box model and sizing at CSS Tricks.

Depending on the context, you may override as-needed (Option 1) or reset the box-sizing for entire regions (Option 2).

Accessibility

Bootstrap follows common web standards and—with minimal extra effort—can be used to create sites that are accessible to those using AT .

Skip navigation

If your navigation contains many links and comes before the main content in the DOM, add a Skip to main content link before the navigation (for a simple explanation, see this A11Y Project article on skip navigation links). Using the .sr-only class will visually hide the skip link, and the .sr-only-focusable class will ensure that the link becomes visible once focused (for sighted keyboard users).

Due to long-standing shortcomings/bugs in Chrome (see issue 262171 in the Chromium bug tracker) and Internet Explorer (see this article on in-page links and focus order), you will need to make sure that the target of your skip link is at least programmatically focusable by adding tabindex=»-1″ .

In addition, you may want to explicitly suppress a visible focus indication on the target (particularly as Chrome currently also sets focus on elements with tabindex=»-1″ when they are clicked with the mouse) with #content:focus < outline: none; >.

Note that this bug will also affect any other in-page links your site may be using, rendering them useless for keyboard users. You may consider adding a similar stop-gap fix to all other named anchors / fragment identifiers that act as link targets.

Nested headings

When nesting headings (

), your primary document header should be an

. Subsequent headings should make logical use of

such that screen readers can construct a table of contents for your pages.

Color contrast

Currently, some of the default color combinations available in Bootstrap (such as the various styled button classes, some of the code highlighting colors used for basic code blocks, the .bg-primary contextual background helper class, and the default link color when used on a white background) have a low contrast ratio (below the recommended ratio of 4.5:1). This can cause problems to users with low vision or who are color blind. These default colors may need to be modified to increase their contrast and legibility.

Additional resources

License FAQs

Bootstrap is released under the MIT license and is copyright 2019 Twitter. Boiled down to smaller chunks, it can be described with the following conditions.

It requires you to:

  • Keep the license and copyright notice included in Bootstrap’s CSS and JavaScript files when you use them in your works

It permits you to:

  • Freely download and use Bootstrap, in whole or in part, for personal, private, company internal, or commercial purposes
  • Use Bootstrap in packages or distributions that you create
  • Modify the source code
  • Grant a sublicense to modify and distribute Bootstrap to third parties not included in the license

It forbids you to:

  • Hold the authors and license owners liable for damages as Bootstrap is provided without warranty
  • Hold the creators or copyright holders of Bootstrap liable
  • Redistribute any piece of Bootstrap without proper attribution
  • Use any marks owned by Twitter in any way that might state or imply that Twitter endorses your distribution
  • Use any marks owned by Twitter in any way that might state or imply that you created the Twitter software in question

It does not require you to:

  • Include the source of Bootstrap itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it
  • Submit changes that you make to Bootstrap back to the Bootstrap project (though such feedback is encouraged)

The full Bootstrap license is located in the project repository for more information.

Translations

Community members have translated Bootstrap’s documentation into various languages. None are officially supported and they may not always be up to date.

We don’t help organize or host translations, we just link to them.

Finished a new or better translation? Open a pull request to add it to our list.

Designed and built with all the love in the world by @mdo and @fat. Maintained by the core team with the help of our contributors.

Читайте также:  Windows 10 оптимизировать озу
Оцените статью