Home >Web Front-end >CSS Tutorial >Why Does IE8 Display Twitter Bootstrap 3's Mobile Version on Desktop, and How Can I Fix It?
IE8 With Twitter Bootstrap 3
In this webpage, we'll explore the issue of using Twitter Bootstrap 3 with the IE8 browser.
IE8 Issue Description
The user in question encountered an issue when using Twitter Bootstrap 3 in a website. While the website functioned properly in all other required browsers, IE8 displayed elements from the mobile version of Bootstrap, stretched across the full screen of the desktop.
The user identified the problem as IE8 favoring mobile-first design in Twitter Bootstrap. Additionally, the max-width CSS properties were not being pulled in by the container class as intended.
Solution
To resolve this issue, the user needs to utilize the respond.js library, which enables media query support in IE8. This is because Bootstrap requires media query support to function correctly.
Steps to Implement the Solution
<!--[if lt IE 9]> <script src="path/to/respond.min.js"></script> <![endif]-->
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .container { max-width: none; } }
Additional Information
The above is the detailed content of Why Does IE8 Display Twitter Bootstrap 3's Mobile Version on Desktop, and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!