Home  >  Article  >  Web Front-end  >  How to introduce network files in bootstrap

How to introduce network files in bootstrap

下次还敢
下次还敢Original
2024-04-05 02:39:19650browse

Bootstrap has two ways to introduce networked files: through a CDN (step 1) or by downloading and hosting local files (step 2).

How to introduce network files in bootstrap

Bootstrap introduces networking files

There are two main ways to introduce Bootstrap networking files:

1. Via CDN

A CDN (Content Delivery Network) is a distributed server network that serves static content quickly and efficiently. Bootstrap provides a CDN for delivering its files:

<code class="html"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.min.js"></script></code>

2. Download Bootstrap files via local files

and host them on a local server:

  • Download the Bootstrap compressed file: https://getbootstrap.com/docs/4.5/getting-started/download/
  • Extract the downloaded file to a local folder
  • Reference local files in your HTML document:
<code class="html"><link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script></code>

NOTE:

  • Make sure you are using the correct Bootstrap version. The above code is for Bootstrap 4.5.2.
  • Make sure all files are linked correctly and in the appropriate location.
  • If you use a CDN, make sure your internet connection is stable so your files can load quickly.

The above is the detailed content of How to introduce network files in bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn