This time I use bootstrap3.4 to make a responsive one. I have explained in detail the selection of bootstrap version in the previous article. The method is relatively simple, with screenshots and instructions. , should all understand. First download the bootstrap source code, unzip it and copy all 3 folders in the dist folder to your project (or the template folder, please note that these 3 folders must be placed together and cannot be separated).
Add responsive meta
The web page needs to be written in HTML5, and put these three meta tags in the head at the beginning After the tags, the following three tags 4 to 6 must be placed at the front and cannot be placed in other positions and must be present to achieve responsiveness.
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上面4~6的3个meta标签必须要添加且放在最前面-->
Reference css files
Reference bootstrap css files in html:
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
Explain separately the css and js provided in the bootstrap folder folder, bootstrap.css and bootstrap.js are uncompressed source files that can be continued to be written and modified. The volume will be slightly larger and suitable for modifications; the js and css files with min are compressed. The final file cannot be modified. When using cdn to load the reference, you usually choose the file with min. It is enough to understand these.
Related recommendations: "bootstrap Getting Started Tutorial"
Quoting js files
Quoting the js file of bootstrap: bootstrap.js, it should be noted that bootstrap relies on the jQuery plug-in, so the jQuery file must be introduced together; the jQuery version supported by bootstrap3.4 cannot exceed the jquery-1.12.4 version, and higher jQuery does not Supports bootstrap3.4. If it is bootstrap4 or above, it can support the latest version of jQuery. You also need to note that the jQuery.js file must be placed in front of the bootstrap.js folder. According to experience, if the position is upside down, sometimes the page loading will be very slow~
<script type="text/javascript" src="js/jquery-1.12.4.min.js"> </script> <script type="text/javascript" src="js/bootstrap.js"> </script>
Solution to compatibility with browsers below IE9
In order for bootstrap3.4 to display normally on browsers below IE9, you need to add the following code in front of the tag to introduce html5shiv.min.js and respond.min These two js files, .js, are compatible with browsers below IE9 because of the code below, so don’t forget it.
<!--[if lt IE 9]><script src="js/html5shiv.min.js"></script><script src="js/respond.min.js"></script><![endif]-->
The complete code is as follows. Please note that the responsive meta tag must be placed at the front. The bootstrap css file must also be placed in front of other css. The bootstrap js file can be placed within the head tag and loaded in the footer, but the jQuery file must be introduced at the same time. To achieve compatibility with browsers below IE8, you need to add compatible js.
The above is the detailed content of How to make bootstrap responsive. For more information, please follow other related articles on the PHP Chinese website!

BootstrapisafreeCSSframeworkthatsimplifieswebdevelopmentbyprovidingpre-styledcomponentsandJavaScriptplugins.It'sidealforcreatingresponsive,mobile-firstwebsites,offeringaflexiblegridsystemforlayoutsandasupportivecommunityforlearningandcustomization.

Bootstrapisafree,open-sourceCSSframeworkthathelpscreateresponsive,mobile-firstwebsites.1)Itoffersagridsystemforlayoutflexibility,2)includespre-styledcomponentsforquickdesign,and3)ishighlycustomizabletoavoidgenericlooks,butrequiresunderstandingCSStoop

Bootstrap is suitable for quick construction and small projects, while React is suitable for complex and interactive applications. 1) Bootstrap provides predefined CSS and JavaScript components to simplify responsive interface development. 2) React improves performance and interactivity through component development and virtual DOM.

The main purpose of Bootstrap is to help developers quickly build responsive, mobile-first websites. Its core functions include: 1. Responsive design, which realizes layout adjustments of different devices through a grid system; 2. Predefined components, such as navigation bars and modal boxes, ensure aesthetics and cross-browser compatibility; 3. Support customization and extensions, and use Sass variables and mixins to adjust styles.

Bootstrap is better than TailwindCSS, Foundation, and Bulma because it is easy to use and quickly develop responsive websites. 1.Bootstrap provides a rich library of predefined styles and components. 2. Its CSS and JavaScript libraries support responsive design and interactive functions. 3. Suitable for rapid development, but custom styles may be more complicated.

Integrating Bootstrap in React projects can be done in two ways: 1) introduced using CDN, suitable for small projects or rapid prototyping; 2) installation using npm package manager, suitable for scenarios that require deep customization. With these methods, you can quickly build beautiful and responsive user interfaces in React.

Advantages of integrating Bootstrap into React projects include: 1) rapid development, 2) consistency and maintainability, and 3) responsive design. By directly introducing CSS files or using the React-Bootstrap library, you can use Bootstrap's components and styles efficiently in your React project.

Bootstrap is a framework developed by Twitter to help quickly build responsive, mobile-first websites and applications. 1. Ease of use and rich component libraries make development faster. 2. The huge community provides support and solutions. 3. Introduce and use class names to control styles through CDN, such as creating responsive grids. 4. Customizable styles and extension components. 5. Advantages include rapid development and responsive design, while disadvantages are style consistency and learning curve.


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

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software