CDN Quickstart
The official guide for how to include Bootstrap’s CSS and JavaScript in your project using a CDN.
Get started using Bootstrap in seconds by including our production-ready CSS and JavaScript by using a CDN without the need for any build steps. CDNs provide copies of Bootstrap’s codebase that’s ready to be used in any environment with minimal code changes required on your part.
Live demo
Already familiar with setting up HTML pages? See the end result in this Bootstrap CodePen demo.
Steps
-
Create a new
index.htmlfile 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>Modus Bootstrap demo</title> </head> <body> <h1>Hello, world!</h1> </body> </html> -
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 Floating UI for positioning menus, popovers, and tooltips, and Vanilla Calendar Pro for the datepicker) 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>Modus Bootstrap demo</title> <link href="https://cdn.jsdelivr.net/npm/modus-bootstrap@6.0.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> </head> <body> <h1>Hello, world!</h1> <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-I2J4jlw924JZXHU9un9Mcuixq/rKhd5A8/B1NQ6ifPAiBFacZjwNcec8d6L38jQv" crossorigin="anonymous"></script> </body> </html>You can also include Floating UI and Vanilla Calendar Pro and our JS separately via an import map. If you don't plan to use menus, popovers, or tooltips, save some kilobytes by not including Floating UI. If you don't plan to use the datepicker, you can omit Vanilla Calendar Pro.
<script type="importmap"> { "imports": { "@floating-ui/dom": "https://cdn.jsdelivr.net/npm/@floating-ui/dom@1.7.6/dist/floating-ui.dom.esm.min.js", "vanilla-calendar-pro": "https://cdn.jsdelivr.net/npm/vanilla-calendar-pro@3.1.0/index.mjs" } } </script> <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-Php492snRLTR5p+hMyxpV6gYwp1avWXn4AaX31MgANrvsjr9Dpodl3Nw60L7Pewl" crossorigin="anonymous"></script> -
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.
Optional font
Bootstrap's source code defaults to a native font stack, but we use a custom font for our hosted documentation to for more consistent styling across platforms. We use Geist and Geist Mono, and recommend using the same or similar in your project.
-
Add the Geist web font from Google Fonts. Add the following to your
<head>, before Bootstrap’s CSS:<!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 rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/modus-bootstrap@6.0.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> </head> <body> <h1>Hello, world!</h1> <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha1/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script> </body> </html> -
Apply the fonts by overriding Bootstrap’s CSS variables. You can do this in a
<style>tag in your<head>or in a custom CSS file.<style> :root { --bs-body-font-family: "Geist", system-ui, sans-serif; --bs-font-mono: "Geist Mono", ui-monospace, monospace; } </style>You can also do the same in your custom Sass file should you graduate from a CDN setup to one that includes Bootstrap via a package manager.
Learn more about Bootstrap’s typography defaults in Typography and Reboot.