Bootstrap introduces HTML
How to introduce Bootstrap into HTML?
Introduce Bootstrap into HTML by following these steps:
Download the Bootstrap file:
Copy the CSS and JS files:
bootstrap.css in the unzipped folder Copy to your HTML file directory. bootstrap.js in the unzipped folder to your HTML file directory. Link CSS and JS files in HTML:
In HTML file < ;head> section, link to the stylesheet:
<code class="html"><link rel="stylesheet" href="bootstrap.css"></code>
At the bottom of the HTML file, link to the JavaScript:
<code class="html"><script src="bootstrap.js"></script></code>
Example:
<code class="html"><!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="bootstrap.css">
</head>
<body>
<div class="container">
<h1>Hello, Bootstrap!</h1>
</div>
<script src="bootstrap.js"></script>
</body>
</html></code>Use CDN:
You can also use CDN (Content Delivery Network) to introduce Bootstrap, it can Improve loading speed and performance.
Use the following code in the <head> section of the HTML file:
<code class="html"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"></script></code>
The above is the detailed content of How to introduce html in bootstrap. For more information, please follow other related articles on the PHP Chinese website!