Solution for all IE series to support Bootstrap_javascript skills
I recently made a Web website. I always thought bootstrap was very good. This time I used bootstrap3. There is no problem in chrome, firefox, safari, opera, 360 browser (speed mode), Sogou browser and other browsers. However, I found that the styles could not be displayed under IE8 and IE11, and then searched various Baidu, and finally solved the problem with the help of a netizen’s post. The solution is summarized as follows:
First you need to make sure there is a DOCTYPE declaration at the beginning of your HTML page. DOCTYPE tells the browser what HTML or XHTML specification to use to parse HTML documents, specifically affecting:
Constraint rules for marking attributes and properties
It has an impact on the browser’s rendering mode. Different rendering modes will affect the browser’s parsing of CSS code and even JavaScript scripts
DOCTYPE is very critical. The current best practice is to type in the first line of the HTML document:
<!DOCTYPE html>
The master’s post summarized several reasons for searching for bootstrap. First of all, Bootstrap3 was developed with the principle of mobile devices first, so the reasons may be as follows:
1. The remote address is not called correctly
That is, as long as it is IE9 or below, two special js are called
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script> <script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]-->
But I tested and found that just using the above js file is not feasible,
2. The calling method is incorrect
Do not use file:// or @import forms to reference respond.min.js or respond.js or css files
3. Mark the content of the browser (use meta tags to adjust the rendering method of the browser)
bootstrap does not support IE compatibility mode. In order to allow IE browser to run the latest rendering mode, the following tags will be added to the page
IE=edge means that the latest kernel of IE is forced to be used. chrome=1 means that if the browser plug-in Google Chrome Frame for IE6/7/8 and other versions is installed (it can make the user's browser still have the menu and interface of IE, but the user When browsing the web, the Chrome browser kernel is actually used), then the Chrome kernel is used for rendering. For a detailed explanation of this meta tag, please refer to the excellent answers on StackOverflow. For an expert explanation of the tag in English, please refer to
http://stackoverflow.com/questions/6771258/whats-the-difference-if-meta-http-equiv-x-ua-compatible-content-ie-edge-e
I added a sentence
Then that’s it
The kernel controls the Meta tag. Because the current domestic mainstream browsers are dual-core, the meta tag is added to tell the browser which kernel to use to render the page
4.IE8 does not support several properties of container
IE8 does not fully support the use of box-sizing: border-box with min-width, max-width, min-height or max-height. Therefore, the container class in bootstrap v3.0.1 is no longer Use max-width.
5. Problems caused by the order in which JS and CSS are introduced
Must quote css first and then quote js
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" media="screen"/> <script type="text/javascript" src="js/respond.min.js"></script>
6. There are blank lines before and after DOCTYPE
It doesn’t work if there are spaces here, you have to remove them
7. You can also manually modify bootstrap.css
If you are using bootstrap2.1.1, modifying navbar-inner{ filter:none} can solve the problem. If you are using version 3.0, this code is no longer available. For details, please see the link
http://stackoverflow.com/questions/12460190/bootstrap-navbar-does-not-show-in-ie8
8. Use quirks mode (compatibility mode)
When defining a web page, the mode that is backward compatible with old browsers is quirks mode, and the corresponding "standard mode" is standard mode. Specifically, write as before
http://www.w3.org/TR/html4/strict.dtd">
I’ve tested this and it doesn’t work
Finally, I passed the test under IE11, but when I tested under IE8, I found a problem that placeholder is not supported
The following is how to solve the problem of IE supporting placeholder
The jquery cited in this article is 1.11.1 and passed the test. First quote jquery
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
You can also use other jquery versions
Then introduce
The download address of the jquery.placeholder.js filehttps://github.com/mathiasbynens/jquery-placeholder
Then add the code to the file
<script type="text/javascript"> $(function () { // Invoke the plugin $('input, textarea').placeholder(); }); </script>
The above IE6, 7, 8, 9, 10, 11, chrome, firefox, safari, opera, 360 browser (speed mode), Sogou browser test passed, only IE5.5 does not seem feasible, in short the problem is solved At this point, the evil IE6 - just call it soy sauce

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

There is no absolute salary for Python and JavaScript developers, depending on skills and industry needs. 1. Python may be paid more in data science and machine learning. 2. JavaScript has great demand in front-end and full-stack development, and its salary is also considerable. 3. Influencing factors include experience, geographical location, company size and specific skills.

JavaScript is the cornerstone of modern web development, and its main functions include event-driven programming, dynamic content generation and asynchronous programming. 1) Event-driven programming allows web pages to change dynamically according to user operations. 2) Dynamic content generation allows page content to be adjusted according to conditions. 3) Asynchronous programming ensures that the user interface is not blocked. JavaScript is widely used in web interaction, single-page application and server-side development, greatly improving the flexibility of user experience and cross-platform development.

How to merge array elements with the same ID into one object in JavaScript? When processing data, we often encounter the need to have the same ID...

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...

Discussion on the realization of parallax scrolling and element animation effects in this article will explore how to achieve similar to Shiseido official website (https://www.shiseido.co.jp/sb/wonderland/)...

Learning JavaScript is not difficult, but it is challenging. 1) Understand basic concepts such as variables, data types, functions, etc. 2) Master asynchronous programming and implement it through event loops. 3) Use DOM operations and Promise to handle asynchronous requests. 4) Avoid common mistakes and use debugging techniques. 5) Optimize performance and follow best practices.

JavaScript can be run in PowerPoint, and can be implemented by calling external JavaScript files or embedding HTML files through VBA. 1. To use VBA to call JavaScript files, you need to enable macros and have VBA programming knowledge. 2. Embed HTML files containing JavaScript, which are simple and easy to use but are subject to security restrictions. Advantages include extended functions and flexibility, while disadvantages involve security, compatibility and complexity. In practice, attention should be paid to security, compatibility, performance and user experience.
