Bootstrap 5 for Internet Explorer 11
npm install bootstrap-ie11




Bootstrap 5 drops support for Internet Explorer 11, but you can add support back by simply adding a CSS file and a few JavaScript polyfills.
- Download the latest release
- Clone the repository git clone https://github.com/coliff/bootstrap-ie11.git
- Install with npm npm install bootstrap-ie11
- Install with Yarn yarn add bootstrap-ie11
- Install with Composer composer require coliff/bootstrap-ie11
Just add this in the which will load the CSS and JS - just for IE users.
``html`
If you'd prefer to load the bootstrap-ie11 CSS without JavaScript you could use an IE-only media query as follow:
`html`
The CSS can be loaded via a CDN:
`html`
To enhance the maintainability and readability of your HTML, you can split the document.write method when adding Bootstrap 5 and necessary polyfills for Internet Explorer 11. Below is an example of how you can split the document.write method:
`html`
For environments where you need local copies of the dependencies, follow these steps to download and reference them locally:
- Bootstrap CSS - download the .css and corresponding .map files
- Bootstrap JS - download the .js and corresponding .map files
- IE11 Custom Properties
- Element QSA Scope
- PolyFill - this seems to load dynamically based on what functionality the browser making the requests is missing, here's what I did as a workaround:
1. Open IE11 or Edge in IE11 mode (search "IE mode" in Edge settings to find and enable)
2. Copy/paste the URI in the src attribute of the
`
If Internet Explorer is running in Compatibility Mode, it'll behave like an earlier version which could prevent bootstrap-ie11 from working properly. To ensure Internet Explorer 11 does not run your site in compatibility mode, add the following meta tag to your page:
`html`
- Grid flexbug workaround
- Workaround for the SVG overflow bug
- Remove the default vertical scrollbar from textarealegend
- Correct the text-wrapping and color inheritance for pre
- Disable auto-hiding scrollbar to avoid overlap on justify-content-evenly
- Fixes for card image size bug
- Fixes for text color and text opacity utility classes
- Improved layout for flex utilitytemplate
- Fixes for stacks gap spacing
- Add the correct display values for and main.modal-dialog-centered
- Fixes for modals ( and .modal-dialog-scrollable)btn-close-white
- Fixes for forms (inputs, checkboxes, radio buttons, switches, selects, ranges, placeholders and floating labels)
- Fix for the SVG icon colorvalid-tooltip
- Fix for dark carousel previous and next SVG icon colors
- Fix for & invalid-tooltip positioninguser-select-auto
- Adds vendor prefixes for and user-select-none utilities.visually-hidden
- Fix for utility class.vr
- Fix for vertical rule class
- Bootstrap 5 Beta 2 is loaded via CDN (The JavaScript in Bootstrap 5 Beta 3 and later is incompatible)
- Polyfill for CSS custom properties (ie11CustomProperties)
- Polyfill to fix most JavaScript components (Polyfill)
- Polyfill to fix tabs (element-qsa-scope polyfill)
- Fixes for Accordion button icons
- Fix for border utility classes
- Internet Explorer 11 does not support vertical alignment of flex items when the flex container has a min-height. See Flexbugs #3 for more details.!important
- The ie11CustomProperties polyfill currently removes the from any CSS variables with that set. See ie11CustomProperties issue #62..img-fluid
- SVG images with are sometimes disproportionately sized. To fix this, add width: 100%; or .w-100 where necessary. This fix improperly sizes other image formats, so this isn't applied automatically.body{font-family:"Segoe UI", Arial, sans-serif;}` to your IE11-only style sheet so there isn't a delay in the text displaying.
- There is a slight delay before the ie11CustomProperties polyfill works its magic. Consider adding
- View a list of known issues at https://github.com/coliff/bootstrap-ie11/issues.
- From Bootstrap 5.2 onwards, CSS custom properties are used extensively which can cause issues with the ie11CustomProperties polyfill.
See this in action at: https://coliff.github.io/bootstrap-ie11/tests/
Thanks to BrowserStack for providing the infrastructure that allows us to test in real browsers