This may be a stupid question, but I've downloaded Bootstrap 3 to make a new website.
Am I supposed to / Is the best practice to copy the entire Bootstrap folder into my New Website folder? And then this would be the easiest way to upload the server eventually? And do this for every new project?
Or am I supposed to just leave one copy in the Bootstrap 3 folder and reference it with my code?
I looked everywhere for this and can't seem to find a good answer, maybe this is just obvious to everyone. Thanks for any help!
You can very well use the CDN (Content Delivery Network) to serve the Bootstrap files.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
Including the above will eliminate your issue to add the bootstrap files to every folder. Moreover, you are not supposed to add it in every folder. Say if you have a site as http://example.com/
, you need to create two directories, namely js
and css
and add the files there, and link this way throughout the site structure:
<link href="/css/bootstrap.min.css" rel="stylesheet" />
<script src="/js/bootstrap.min.js"></script>
Notice the /
at the starting of the URL, which says this is a relative to domain
URL. You need to use the above HTML to add the bootstrap content to all the pages, if you are using a template (that has headers and loads it on all the pages).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With