• Stars
    star
    280
  • Rank 146,615 (Top 3 %)
  • Language
    HTML
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bootstrap 4 for IE8 and IE9

LICENSE NPM Downloads github-stars-image code style: prettier

Bootstrap 4 for IE8 and IE9

Bootstrap 4 drops support for Internet Explorer 8 and 9, but you can add it back by simply adding a conditional statement targeting IE 8 and 9 with a CSS file and a CDN-hosted JavaScript file to polyfill HTML5 element support.

Quick start

Several quick start options are available:

  • Download the latest release
  • Clone the repo git clone https://github.com/coliff/bootstrap-ie8.git
  • Install with npm npm install bootstrap-ie8
  • Install with yarn yarn add bootstrap-ie8
  • Install with Composer composer require coliff/bootstrap-ie8:4.3.1

Usage

  1. Add <meta http-equiv="x-ua-compatible" content="ie=edge"> to the top of the of your page

  2. Add the following conditional statements to the <head> of your page but after the Bootstrap 4 CSS:

<!--[if IE 9]>
  <link href="https://cdn.jsdelivr.net/gh/coliff/bootstrap-ie8/css/bootstrap-ie9.min.css" rel="stylesheet">
<![endif]-->
<!--[if lte IE 8]>
  <link href="https://cdn.jsdelivr.net/gh/coliff/bootstrap-ie8/css/bootstrap-ie8.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/g/[email protected]"></script>
<![endif]-->

Optional JavaScript Fix

To fix the dropdown menus and modals you can add the following to the footer:

<!--[if gte IE 9]><!-->
  <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<!--<![endif]-->
<!--[if IE 9]>
  <script src="https://cdn.jsdelivr.net/gh/coliff/bootstrap-ie8/js/bootstrap-ie9.min.js"></script>
<![endif]-->
<!--[if lte IE 8]>
  <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
  <script src="https://cdn.jsdelivr.net/gh/coliff/bootstrap-ie8/js/bootstrap-ie8.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.js"></script>
<![endif]-->

This will load jQuery, PopperJS and Bootstrap as normal on all browsers other than IE8. IE9 will load the bootstrap-ie9.js script. IE8 will load the latest compatible version of jQuery, the unminified Bootstrap JS (the minified version causes an error) and the bootstrap-ie8.js fix.

FAQS

Q. What does this fix/polyfill?

A. Internet Explorer 9 doesn't support flexbox so there is a float-based layout fallback and a couple of other minor fixes. Internet Explorer 8 doesn't support rem units so all units are specified in pixels. Media Queries are also not supported so IE8 has a fixed-width layout (min-width 998px).

Q. Is the CSS hosted on a CDN?

A. Yes, thanks to JSDelivr minified versions are available with the direct links:

Q. Will you provide LESS/SASS files?

A. Maybe in a future release I'll provide SASS file (with comments).

Q. Do I need the RespondJS polyfill for IE8 like Bootstrap 3 uses?

A. No. Instead the CSS is set to be fixed-width which makes things a lot easier. You don't need to change your HTML markup, the CSS will take care of it as the (min-width:992px) media queries are all set.

Q. Where can I see a demo?

A. Right here: http://coliff.github.io/bootstrap-ie8/test.htm

Known Issues

Thanks

BrowserStack Logo

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

More Repositories

1

bootstrap-ie7

Bootstrap 3 CSS for IE7
575
star
2

dark-mode-switch

Add a dark-mode theme toggle with a Bootstrap Custom Switch
HTML
529
star
3

bootstrap-ie11

Internet Explorer 11 compatibility solution for Bootstrap 5
HTML
93
star
4

bootstrap-print-css

Print Stylesheet for Bootstrap 5
40
star
5

inputmodes.com

Testing inputmode
39
star
6

awesome-website-testing-tools

Resource of web-based testing and validation tools
31
star
7

bootstrap-show-password-toggle

A show password as text toggle for Bootstrap forms
HTML
28
star
8

html5-email-regex

Pure HTML5 Email validator which checks valid TLDs with no JavaScript
HTML
17
star
9

bootstrap-rfs

Easy-to-add CSS for adding Responsive Font Sizes (RFS) to Bootstrap 4
15
star
10

Brackets-HTML5CodeHints

Extend Brackets own code hints with more HTML5 elements and attributes such as Picture, Srcset, Template +more.
JavaScript
14
star
11

freshdesk-messaging-facade

A faster Freshdesk Messaging (formerly Freshchat) Facade
JavaScript
9
star
12

geoip-db-country-select

πŸ—ΊοΈ Auto select country from a dropdown using GEOIP DB and jQuery
HTML
7
star
13

Brackets-CSSCodeHints

Extends Bracket's CSS code hints with more attributes; clip-path, image-rendering, tab-size, touch-action and more
JavaScript
6
star
14

keyata

Chrome extension to enable media keys for music/video playback
JavaScript
5
star
15

font-awesome-background-svg

font-awesome-background-svg
CSS
3
star
16

bootstrap-5-migrate-tool

A command-line tool designed to help you upgrade your Bootstrap 4 projects to Bootstrap 5
HTML
2
star
17

sender-brand-icon-avatars-for-email

The .CSV used to generate the CSS for Sender Avatar Icons Browser Extension
2
star
18

new.caniuse.email

Rebuilt from the groundup with Jekyll
Ruby
2
star
19

purgecss-test

Testing PurgeCSS with Hugo
CSS
1
star
20

coliff

1
star
21

dotfiles

πŸ”§ .files
1
star
22

prevent-pii-tracking-in-google-analytics

Prevent PII being tracked in Google Analytics
HTML
1
star
23

bootstrap-forced-colors-css

Improves the accessibility of Bootstrap 5 for Windows users using High Contrast themes
HTML
1
star
24

WP-SmartAppBanner

WordPress plugin which allows you to quickly and easily add an iOS Smart App Banner
PHP
1
star