📅  最后修改于: 2023-12-03 14:59:32.480000             🧑  作者: Mango
Bootstrap is a popular front-end development framework for building responsive, mobile-first websites. It includes a set of CSS styles and JavaScript plugins that make it easy to create clean and modern user interfaces.
One convenient way to use Bootstrap is through a CDN, or Content Delivery Network. A CDN is a network of servers that helps distribute content around the world, making it faster and more reliable for users.
When you use a Bootstrap CDN, you don't have to download and host the Bootstrap files on your own website. Instead, you can reference them directly from the CDN, which will handle the delivery and caching of the files.
To use a Bootstrap CDN, simply add the following code to the <head>
section of your HTML document:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css" integrity="sha384-Odh/qJgDXi0aYTHy5yy5R5e/xifVjOSLr0ZiV7/cuoH3G1V7ggK8lQ0oOlnauVo+" crossorigin="anonymous">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.min.js" integrity="sha384-2QH5X9Vs5y5/b5y5o5CSKpWKrCgeHQKjEaRv4aJqbOtft9X3Kd6Va+Ye6UJ2Q/pG" crossorigin="anonymous"></script>
This code will reference the latest version of Bootstrap (currently version 5.0.0) from the jsDelivr CDN. You can also customize the version and other options if needed.
Using a Bootstrap CDN has several benefits, including:
Overall, using a Bootstrap CDN is a convenient and effective way to improve the performance and user experience of your website.