Bootstrap 5 for IE 11

Bootstrap 5 for IE 11

LICENSE github-stars-image

Bootstrap 5 (currently in Alpha) drops support for Internet Explorer 11, but you can add support back by simply adding a CSS file and a few JavaScript polyfills.

Quick start


Just add this in the <head> which will load the CSS and JS - just for IE users.

<script>window.MSInputMethodContext && document.documentMode && document.write('<link rel="stylesheet" href="/css/bootstrap-ie11.min.css"><script src=""><\/script><script crossorigin="anonymous" src=""><\/script><script>!function () { var e, t; ((e = document.createEvent("CustomEvent")).initEvent("Bootstrap", !0, !0), e.preventDefault(), e.defaultPrevented) || (t = Event.prototype.preventDefault, Event.prototype.preventDefault = function () { this.cancelable && (, Object.defineProperty(this, "defaultPrevented", { get: function () { return !0 }, configurable: !0 })) }) }();<\/script>');</script>

If you’d prefer to load the bootstrap-ie11 CSS without JavaScript you could use an IE-only media query as follow:

<link rel="stylesheet" href="/css/bootstrap-ie11.min.css" media="all and (-ms-high-contrast: active), (-ms-high-contrast: none)">


What does this fix/polyfill

Any other things to look out for


See this in action at:


BrowserStack Logo

Thanks to BrowserStack for providing the infrastructure that allows us to test in real browsers