Do I need to include both the JavaScript and CSS CDN for the bootstrap CDN to work properly, or can I just use one of them?

Which resource should I use for my project?

Should I go with CSS, JS, BUNDLE or all of them? https://i.sstatic.net/0Yi3F.png

I am interested in using button styling, grid, card components (and possibly dropdowns in the future)

https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js

Answer №1

Summary: If you're looking for basic design, stick to a CSS-only file.

If you require interactive elements, also incorporate javascript.

  • CSS is essential
  • JS is flexible

I recommend referring to the official documentation https://getbootstrap.com/docs/4.4/getting-started/introduction/

"Many of our components rely on JavaScript for functionality. Specifically, they need jQuery, Popper.js, and our JavaScript plugins. Place these scripts near the end of your pages before the closing tag to enable them. Start with jQuery, followed by Popper.js, and then our JavaScript plugins."

In essence, if you desire added features like tooltips or dynamic dropdowns, opt for javascript. For simple tasks such as styling and sizing, stick to the CSS link alone (e.g., buttons).


However, if you're using this for learning purposes, consider importing all files initially to avoid any import issues.
Once you feel comfortable, gradually transition to using one CDN link at a time.


If you plan to use bootstrap in a live website, consider utilizing the npm package instead.

npm i bootstrap

(Start with CDN learning first, then transition to npm once you grasp the fundamentals)


Don't forget to utilize the <link> tag to have HTML access the CSS file. Simply copy the initial link presented when you open the dropdown menu

https://i.sstatic.net/Ye6mu.png

Answer №2

When incorporating dropdowns, poppers, and tooltips into your design, it is recommended to utilize all three components. However, if you only require the styling elements, then stick with bootstrap.min.css.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am unfamiliar with this specific JavaScript algorithm problem from Codewars

I need help with a JavaScript algorithm question This problem involves extracting two letters from the middle of odd-numbered characters My confusion lies in function getMiddle(s) { //Code goes here! let answer = ""; if (s.length % 2 !== 0) { a ...

HTML evasion in summernote

Currently, I am utilizing a WYSIWYG editor known as Summernote to input values that are then sent to the server. On the server side, I use HTML Purifier to sanitize the content before storing it in a MySQL database. The challenge arises when trying to disp ...

WebLogic 11g deployment causing a jQuery error stating "Property or method not supported by object."

While deploying my application in WebLogic 9.2, I encountered a JavaScript error stating "Object doesn't support this property or method." Despite the error, the functionality on button click was still working. However, when deploying the same applica ...

Enhancing user experience by implementing a personalized question form using bootstrap

I am creating a user form that utilizes the form-group and row classes. I am looking for suggestions on how to clearly indicate to the user when they have the option to choose between two questions without being required to answer both. <div class=&qu ...

Data displayed in a table-like format

Is there a way to achieve this layout view image here (currently done using tables) while maintaining semantic markup? I believe the best tag for this would be dl. Each cell should have the height of its corresponding row. EDIT: The left column contains d ...

Switching back and forth between disabled and enabled modes on a jQueryUI slider

Fiddle Example I am currently working with a jQueryUI range slider that is initially disabled. $( ".sliderrange" ).slider({ range: true, disabled: true, min: 100, max: 200, values: [ 75, 300 ], slide: function( event, ui ) { $('in ...

Angular first renders a component before removing another one using ng-If

I have two components that are displayed one at a time using an ngif directive. <app-root> <first-Comp *ngIf="showFirst"></first-Comp> <second-Comp *ngIf="!showFirst"></second-Comp> </app-root> Here are some key ...

What is the best way to obtain the current date in JavaScript in the format Mon-DD-YYYY?

Need help with getting the current date in Mon-DD-YYY format using JavaScript. I want to input today's date without the time into a date picker field. My current code is giving errors, below is what I have: Page.prototype.clickOnsessionDate = async f ...

Why might Apple's HTML5 demos incorporate HTML4 doctypes?

Several of Apple's HTML 5 demonstrations include an html4 loose doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> What reasons might they have for opting not to use the HTML5 doctyp ...

Ways to efficiently locate a CSS class amidst numerous stylesheets

Recently, I was assigned a theme for a website that included multiple stylesheets. As I sift through the index.html file, I notice various classes, but struggle to pinpoint which stylesheet they belong to. Instead of manually checking each stylesheet, I ...

I am interested in utilizing Selenium to interact with a hyperlink within an HTML table

I am currently using the code snippet below to fetch data from the HTML structure provided: //findTables(driver); WebElement content = driver.findElement(By.id("tblTaskForms")); List<WebElement> elements = content.findElements(By.className("form-nam ...

Guide to using the PUT method in Node.js Express to update a record using the primary key

I'm currently struggling with understanding the proper usage of the put statement in node js. Here is the code I have been using: app.put("/cars/:id", (req, res) => { //retrieving a record based on id (uuid) e.g. http://localhost:3000/cars/a5ad957 ...

Can you stop an image from being chosen on a website?

I have a website that features a table with text descriptions in the headers and question mark images (users can hover over them for help). Recently, I received a request to allow users to highlight and copy the table without including the images (using c ...

Creating a dynamic form where input fields and their values update based on user input in jQuery

In my form, I have an input field where users will enter an ISBN number. Based on the input number, I need to populate two other input fields: one for book title and one for author name. I am currently calling a JavaScript function on the onblur event of ...

Accessing a function located in a separate file

I am currently developing a Discord bot and I'm looking to define a function in another file to make my code more organized. I have two files: function.js const needle = require("needle"); async function fetch() { const res = await needle("get", ...

Is there a way to have one element automatically expand when another is selected?

I'm currently utilizing the date and time picker from . However, I need some assistance with the current setup. Currently, the date and time pickers are in separate input fields. In order to select a date, I have to click on the Date input field, and ...

Angular2 (RC5) global variables across the application

I am seeking a solution to create a global variable that can be accessed across different Angular2 components and modules. I initially considered utilizing dependency injection in my `app.module` by setting a class with a property, but with the recent angu ...

What is the most efficient way to apply multiple values to the css property outline?

Currently, I am working with IE11 to display a dialog box. The default style for the button in focus includes a dotted border. Is there a way to add an additional value for the outline attribute, like shown below: input[type=button]:focus{ outline: 1p ...

What is the best way to incorporate a fade out transition into the current tab-pane?

I am currently implementing Bootstrap 5.3 with a basic pills and tab structure, and I am looking for a way to smoothly add a fadeOut effect to the active tab before the fadeIn of the selected tab. It appears that simply adding the "fade" class only introd ...

The total height of an HTML element, which takes into account the margin of the element itself

Is there a way to accurately calculate the height of an element including margins, even when dealing with child elements that have larger margins than their parents? HTMLElement.offsetHeight provides the height excluding margin, while this function from ...