When uploading files using Bootstrap do I need to upload all files related to Bootstrap?

Asked

Viewed 23 times

0

I have a question related to uploading files using the Bootstrap framework!

I found very heavy the folder of the site with a single page, so the question is I need to upload all bootstrap files or I have to upload only bootstrap.min.css?

  • It depends: if you just want to use the CSS styles of Bootstrap, CSS is enough. However, if you want to use some Javascript functionality related to BS, then you also have to load the . js from Bootstrap.

  • So among these files in case I just upload the bootstrap.css file.?

  • Then you will only use the BS styles, related to the layout. BS has some features, for example. a hamburger menu... if you want to use it, you will have to use the JS.

  • Order a test removing all files and leaving only the "linked" Bootstrap files in my document and the site did not present problems, I think I got where I was going, thanks!

  • BS only has 2 files: a . css and a . js

1 answer

0

See the initial template suggested by the Bootstrap documentation, there is the link in 02 files:

  • bootstrap.min.css; and
  • bootstrap.bundle.min.js.

Part of the recommended code, at Bootstrap/Starter template:

<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
   
<!-- Option 1: Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

Note also that they used a CDN, with this the upload of these files can become even faster for the end user who already has them cached in the browser. Unlike needing to download them again, saved in your hosting. It is recommended to use also, it can be the same link available in the template.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.