📅  最后修改于: 2023-12-03 15:13:41.426000             🧑  作者: Mango
Bootstrap CDN 4 is a content delivery network for Bootstrap 4, a popular front-end web development framework created by Twitter. It allows developers to easily and quickly add Bootstrap 4 to their website without having to download and host the framework themselves.
Using Bootstrap CDN 4 is simple. All you have to do is include the necessary files in your HTML document. Here's an example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>MyWebsite</title>
<!-- Include Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css">
</head>
<body>
<h1>Hello, World!</h1>
<!-- Include Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js"></script>
</body>
</html>
In this example, we included the Bootstrap CSS and JavaScript files from the CDN by adding their URLs in the link
and script
tags respectively. You can also include the jQuery and Popper.js files if your website requires them.
Here are some advantages of using Bootstrap CDN 4:
Bootstrap CDN 4 is a great option for developers who want to easily and quickly add Bootstrap 4 to their website without having to host the framework themselves. It's easy to use, always up-to-date, and can result in faster load times for your users.