Get started with Bootstrap (2024)

Quick start

Get started by including Bootstrap’s production-ready CSS and JavaScript via CDN without the need for any build steps. See it in practice with this Bootstrap CodePen demo.


  1. Create a new index.html file in your project root. Include the <meta name="viewport"> tag as well for proper responsive behavior in mobile devices.

    <!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap demo</title> </head> <body> <h1>Hello, world!</h1> </body></html>
  2. Include Bootstrap’s CSS and JS. Place the <link> tag in the <head> for our CSS, and the <script> tag for our JavaScript bundle (including Popper for positioning dropdowns, poppers, and tooltips) before the closing </body>. Learn more about our CDN links.

    <!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap demo</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> </head> <body> <h1>Hello, world!</h1> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> </body></html>

    You can also include Popper and our JS separately. If you don’t plan to use dropdowns, popovers, or tooltips, save some kilobytes by not including Popper.

    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>
  3. Hello, world! Open the page in your browser of choice to see your Bootstrapped page. Now you can start building with Bootstrap by creating your own layout, adding dozens of components, and utilizing our official examples.

CDN links

As reference, here are our primary CDN links.

DescriptionURL
CSShttps://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css
JShttps://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js

You can also use the CDN to fetch any of our additional builds listed in the Contents page.

Next steps

  • Read a bit more about some important global environment settings that Bootstrap utilizes.
  • Read about what’s included in Bootstrap in our contents section and the list of components that require JavaScript below.
  • Need a little more power? Consider building with Bootstrap by including the source files via package manager.
  • Looking to use Bootstrap as a module with <script type="module">? Please refer to our using Bootstrap as a module section.

JS components

Curious which components explicitly require our JavaScript and Popper? If you’re at all unsure about the general page structure, keep reading for an example page template.

  • Alerts for dismissing
  • Buttons for toggling states and checkbox/radio functionality
  • Carousel for all slide behaviors, controls, and indicators
  • Collapse for toggling visibility of content
  • Dropdowns for displaying and positioning (also requires Popper)
  • Modals for displaying, positioning, and scroll behavior
  • Navbar for extending our Collapse and Offcanvas plugins to implement responsive behaviors
  • Navs with the Tab plugin for toggling content panes
  • Offcanvases for displaying, positioning, and scroll behavior
  • Scrollspy for scroll behavior and navigation updates
  • Toasts for displaying and dismissing
  • Tooltips and popovers for displaying and positioning (also requires Popper)

Important globals

Bootstrap employs a handful of important global styles and settings, all of which are almost exclusively geared towards the normalization of cross browser styles. Let’s dive in.

HTML5 doctype

Bootstrap requires the use of the HTML5 doctype. Without it, you’ll see some funky and incomplete styling.

<!doctype html><html lang="en"> ...</html>

Viewport meta

Bootstrap is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your <head>.

<meta name="viewport" content="width=device-width, initial-scale=1">

You can see an example of this in action in the quick start.

Box-sizing

For more straightforward sizing in CSS, we switch the global box-sizing value from content-box to border-box. This ensures padding does not affect the final computed width of an element, but it can cause problems with some third-party software like Google Maps and Google Custom Search Engine.

On the rare occasion you need to override it, use something like the following:

.selector-for-some-widget { box-sizing: content-box;}

With the above snippet, nested elements—including generated content via ::before and ::after—will all inherit the specified box-sizing for that .selector-for-some-widget.

Learn more about box model and sizing at CSS Tricks.

Reboot

For improved cross-browser rendering, we use Reboot to correct inconsistencies across browsers and devices while providing slightly more opinionated resets to common HTML elements.

Community

Stay up-to-date on the development of Bootstrap and reach out to the community with these helpful resources.

  • Read and subscribe to The Official Bootstrap Blog.
  • Ask questions and explore our GitHub Discussions.
  • Discuss, ask questions, and more on the community Discord or Bootstrap subreddit.
  • Chat with fellow Bootstrappers in IRC. On the irc.libera.chat server, in the #bootstrap channel.
  • Implementation help may be found at Stack Overflow (tagged bootstrap-5).
  • Developers should use the keyword bootstrap on packages that modify or add to the functionality of Bootstrap when distributing through npm or similar delivery mechanisms for maximum discoverability.

You can also follow @getbootstrap on Twitter for the latest gossip and awesome music videos.

Get started with Bootstrap (2024)

FAQs

How do I use Bootstrap for the first time? ›

Quick start
  1. Create a new index.html file in your project root. Include the <meta name="viewport"> tag as well for proper responsive behavior in mobile devices. <! ...
  2. Hello, world! Open the page in your browser of choice to see your Bootstrapped page.

How to learn Bootstrap for beginners? ›

Table of Contents
  1. Make Sure You Are Fluent With HTML, CSS & JavaScript.
  2. Take An Online Course To Get Yourself Started.
  3. Always Have Reference Guides Handy.
  4. Don't Underestimate The Power Of Videos.
  5. Connect With Other Bootstrap Users.
  6. Time to Take Action and Learn Bootstrap.
Jan 1, 2024

Is Bootstrap easy to learn? ›

Bootstrap: Bootstrap is generally considered easier to learn for beginners due to its pre-designed components and structured approach. Developers can start building basic layouts and incorporating common UI elements without extensive CSS knowledge.

Is Bootstrap still worth it? ›

Yes. Bootstrap is still the most used CSS framework. For its ease of use and widespread support, it's a great choice to complete a project quickly, even in 2024.

How fast can I learn Bootstrap? ›

How Long Does It Take to Learn Bootstrap? The short answer is that it depends on you. If you're a professional developer who already knows HTML, CSS and JavaScript well, you should be able to pick up Bootstrap in a few weeks if you dedicate some time to doing so.

Can I learn Bootstrap in one day? ›

You can learn bootstrap 4 in 30 minutes and make a unique landing page website in a day with the help of this article. Basic knowledge of HTML, JavaScript, and JQuery is recommended. The article covers a variety of topics in Bootstrap that will help you learn more.

Does Bootstrap require coding? ›

Easy to use: Anybody with just basic knowledge of HTML and CSS can start using Bootstrap. Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and desktops.

Is Bootstrap HTML or CSS? ›

Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype.

Do I have to memorize Bootstrap? ›

It's a waste of time if you memorize all Bootstrap classes. It is not recommended. Bootstrap is only a CSS framework that helps you build a responsive website easily. The important thing you must know about a CSS framework is how the grid system works after you have known how CSS works.

Is anything better than Bootstrap? ›

Are there any free Bootstrap alternatives? Yes, many Bootstrap alternatives are open-source and free to use. Some of the notable ones include Bulma, Foundation, Semantic UI, Tailwind CSS, and Material UI. These offer robust features and extensive component libraries without any initial cost.

What to learn before Bootstrap? ›

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web. Bootstrap code consist HTML, CSS and JavaScript. So to understand the bootstrap, you first have to understand the HTML, CSS and JavaScript.

Should I learn tailwind or Bootstrap? ›

If you really care about making your site look just right, Tailwind might be better. But if you need to get a website up fast, Bootstrap could save you a lot of time. The best choice depends on what you need for your project - whether it's more control over the design or faster development.

Why is Bootstrap not used anymore? ›

While Bootstrap is easy to use, it's not so easy to customize as you might think. Some components will require you to use ! important several times, which is not ideal when creating CSS. And having to override the default styles of Bootstrap is just like having to create your own CSS from start.

Should I avoid Bootstrap? ›

If you can create a project without bootstrap then do. because in that case, your website will not need to load bootstrap CSS and JS files. So for a simple project consider avoiding bootstrap if possible.

Do companies still use Bootstrap? ›

However, Bootstrap remains relevant and widely used, particularly for projects that require a faster setup or are comfortable with its predefined components and design patterns. Ultimately, the choice between the two depends on the specific needs and preferences of the development team.

How do I start bootstrapping? ›

How to bootstrap your startup (+tips)
  1. Use loans wisely. SBA loans and micro-loans are a great way to raise quick capital without taking out a second mortgage. ...
  2. Choose the right team. ...
  3. Focus on profitability over quick growth. ...
  4. Lessen outsourcing. ...
  5. Be frugal.

How to use Bootstrap to build a website? ›

Getting Started with Bootstrap
  1. Installing Bootstrap. ...
  2. Setting up the basic HTML structure. ...
  3. Choosing a theme. ...
  4. Creating a responsive navigation bar. ...
  5. Designing a homepage with Hero section. ...
  6. Adding content sections and columns. ...
  7. Implementing responsive images and videos. ...
  8. Creating forms with Bootstrap.
Apr 18, 2024

What is bootstrapping for dummies? ›

Bootstrapping is a statistical procedure that resamples a single dataset to create many simulated samples. This process allows you to calculate standard errors, construct confidence intervals, and perform hypothesis testing for numerous types of sample statistics.

Top Articles
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 5732

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.