Bootstrap Tutorial
Learn Bootstrap step by step: 58 lessons in 11 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- Introduction to Bootstrap Meet Bootstrap 5.3: a CSS and JavaScript toolkit for responsive pages. See what it includes, how it compares with Tailwind and plain CSS, and try it live.
- Installing Bootstrap Add Bootstrap 5.3 to a page with CDN links, understand the bundle versus separate Popper, set up npm and Sass, and use the official starter template.
- Your First Bootstrap Page Build a first Bootstrap 5 page, see what Reboot changes (box-sizing, fonts, margins) and learn how class names such as container and btn map to real CSS.
Layout
- Containers Learn Bootstrap 5 containers: fixed-width .container, full-width .container-fluid, responsive .container-md, max widths per breakpoint, padding and nesting.
- Breakpoints and Responsive Design Understand Bootstrap 5's six breakpoints, mobile-first min-width media queries and responsive class infixes, and learn to test every size in the live editor.
- The Grid System Learn the Bootstrap 5 grid: container, row and col, the 12-column layout, equal-width columns, col-auto, single column widths and how flexbox powers it.
- Responsive Columns Learn how Bootstrap 5.3 columns change width at each breakpoint with col-sm to col-xxl classes, how to mix them, and how row-cols sets equal card counts.
- Gutters, Alignment and Ordering Control the space between Bootstrap columns with g-*, gx-* and gy-*, align and justify columns, reorder them with order-*, and push them with offset-* and ms-auto.
- Nested Grids and Full Layouts Nest rows inside Bootstrap columns, build a dashboard and a blog layout from the 12-column grid, avoid common layout mistakes, and meet the optional CSS grid.
- Sizing Utilities Set widths and heights with Bootstrap w-*, h-* and mw-100, use viewport sizes, keep video and map shapes with the ratio helper, crop images with object-fit.
Content
- Reboot: Bootstrap's Built-in CSS Reset Learn what Bootstrap 5 Reboot changes in plain HTML: box-sizing, the native font stack, margins, lists, code, tables, forms, buttons and the hidden attribute.
- Typography Style text with Bootstrap 5.3: heading classes, display-*, lead, small, mark, blockquotes, abbreviations, unstyled and inline lists, plus fs-* and fw-* utilities.
- Text Utilities Align, wrap, truncate and transform text with Bootstrap 5.3 utilities: text-center, text-md-end, text-truncate, text-break, text-uppercase, lh-*, font-monospace.
- Colors and Backgrounds Learn Bootstrap 5.3 color utilities: theme colors, text-* and bg-* classes, subtle and emphasis variants, opacity, gradients and link colors, with live examples.
- Images and Figures Learn how to make images responsive in Bootstrap 5.3 with img-fluid, style them with img-thumbnail and rounded, use picture, figure and align images.
- Tables Style HTML tables with Bootstrap 5.3: the table class, striped rows, hover, borders, small tables, contextual colors, responsive wrappers and group dividers.
Utilities
- Spacing Utilities Master Bootstrap 5.3 spacing utilities: the m-* and p-* scale, sides and axes, auto margins, responsive spacing, gap utilities and why negative margins are off.
- Display and Visibility Learn Bootstrap 5.3 display utilities: d-* classes, showing and hiding by breakpoint, print display, visibility, overflow, z-index and position helpers.
- Flex Utilities Use Bootstrap 5.3 flex utilities: d-flex, direction, justify-content, align-items, wrap, grow and shrink, fill, auto margins and common centering patterns.
- Helpers: Stretched Link, Vertical Rule, Icon Link and More Learn Bootstrap 5.3 helpers: stretched-link for clickable cards, vr dividers, icon-link, focus-ring, colored links and text-bg, plus ratio and clearfix.
- Borders, Radius and Shadows Add borders, change their color and width, round corners with rounded-* and rounded-pill, and lift elements with shadow-sm, shadow and shadow-lg in Bootstrap 5.
- Interactions, Z-index and Object Fit Utilities Control selection, clicks and stacking with Bootstrap 5.3 utilities: user-select, pe-none, z-index layers and object-fit, with live examples.
- The Utility API See how Bootstrap generates utility classes from a Sass map, how to add your own utilities, and weigh the strengths and limits of the utility-first approach.
Forms and Buttons
- Buttons Style buttons with btn and the color variants, outline buttons, sizes, disabled and active states, button groups, toolbars, link buttons and toggle buttons.
- Form Controls Style text inputs, textareas, file and color pickers with form-control, add labels and help text, and use readonly, plaintext and sizing classes in Bootstrap 5.
- Selects, Checks, Switches and Ranges Style select menus, checkboxes, radios, switches and range sliders in Bootstrap 5, with inline layouts, button-style choices, datalists and accessible markup.
- Input Groups and Floating Labels Attach text, icons and buttons to inputs with input-group, size and combine groups, and build modern floating-label fields with form-floating in Bootstrap 5.
- Form Layout and Validation Lay out Bootstrap forms with the grid, horizontal and inline patterns, then add needs-validated, was-validated, is-valid and invalid-feedback with a small script.
Components
- Navs and Tabs Build Bootstrap navigation with nav, nav-tabs and nav-pills, make it fill or stack vertically, and add working tab panes with the correct ARIA roles.
- The Navbar Build a responsive Bootstrap 5 navbar with navbar-expand-lg, brand, collapse toggler, forms, sticky and fixed positions, color modes and an offcanvas menu.
- Cards Learn Bootstrap 5 cards: card-body, header, footer, images, list groups inside cards, horizontal cards, row-cols card grids and the stretched-link helper.
- Alerts, Badges, Progress and Spinners Use Bootstrap alerts, dismissible alerts, badges, progress bars (striped and animated), spinners and placeholders to give users clear feedback on state and loading.
- List Groups, Breadcrumbs and Pagination Build Bootstrap list groups (flush, actionable, numbered), breadcrumbs with aria-current, and pagination with sizes, active and disabled states and good accessibility.
- Accordion and Collapse Show and hide content with Bootstrap's collapse plugin, build accordions that stay open or close their siblings, and control several panels with data attributes.
- Modals Build Bootstrap 5.3 modal dialogs: markup, sizes, scrollable and centered modals, fullscreen, static backdrops, events, and passing data from the trigger button.
- Dropdowns, Tooltips and Popovers Create Bootstrap 5.3 dropdown menus, split buttons, tooltips and popovers, learn how Popper positions them, and enable the opt-in ones with JavaScript.
- Carousel, Offcanvas and Toasts Build a Bootstrap 5.3 carousel with indicators and controls, slide-in offcanvas panels from any edge, and stacked toast notifications, with accessibility notes.
JavaScript and Interactivity
- Bootstrap JavaScript Plugins Understand how Bootstrap 5 plugins work: data attributes versus the JavaScript API, getOrCreateInstance, dispose, Popper in the bundle, no jQuery, and module imports.
- Plugin Events and Programmatic Control Listen to Bootstrap 5 plugin events such as show.bs.modal and hidden.bs.collapse, cancel actions with preventDefault, control components from code, and use ScrollSpy.
- Skeleton Loaders, Scrollspy and Sticky Navigation Build skeleton loaders with Bootstrap placeholders and swap in real content, then create a docs layout with a sticky sidebar and ScrollSpy.
Customizing
- Customizing with CSS Variables Restyle Bootstrap 5.3 with its --bs-* CSS variables: change colors, fonts and radius on :root, tune single components, and know which variables really apply.
- Customizing with Sass Compile Bootstrap from Sass: override variable defaults, add theme colors with map-merge, import only the parts you need and ship a smaller custom CSS file.
- Color Modes and Dark Mode Use Bootstrap 5.3 color modes: set data-bs-theme on the page or one component, follow prefers-color-scheme and build a light, dark and auto switcher.
- Building a Custom Theme Design a reusable Bootstrap 5.3 theme: pick a palette that passes contrast, set fonts, radius and shadows, add custom components and keep it versioned.
- RTL Support in Bootstrap Support Arabic and Hebrew with Bootstrap 5.3: dir and lang, the RTL stylesheet, start and end utilities, RTLCSS and logical CSS for your own code.
Quality
- Accessibility in Bootstrap Build accessible Bootstrap pages: semantic markup, the ARIA attributes components need, modal focus, visually-hidden text, skip links, contrast and reduced motion.
- Performance and Best Practices Make Bootstrap pages fast and maintainable: know the file sizes, choose CDN or self-hosting, add SRI, avoid override fights, trim unused CSS and plan a v4 upgrade.
- Bootstrap with Vite, Webpack and npm Install Bootstrap 5.3 with npm and bundle it with Vite or webpack. Import only the Sass and JavaScript you need, avoid pitfalls and keep CSS small.
- Migrating from Bootstrap 4 and Using Icons Upgrade a Bootstrap 4 page to Bootstrap 5: renamed classes, removed jQuery and data-bs-* attributes. Then add Bootstrap Icons as a font or an SVG sprite.
- Using Bootstrap with React and Vue Use Bootstrap 5 in React and Vue: plain CSS classes, who controls the DOM, react-bootstrap and bootstrap-vue-next, and when to avoid its JavaScript.
Projects
- Project: Landing Page Build a complete responsive landing page with Bootstrap 5: navbar, hero, feature grid, pricing cards, testimonials and footer, using only classes and no custom CSS.
- Project: Admin Dashboard Build a responsive admin dashboard with Bootstrap 5: an offcanvas sidebar that becomes permanent on desktop, stat cards, a data table, progress bars and tabs.
- Project: Blog Layout Build a two-column Bootstrap 5 blog: breadcrumbs, article list with cards, sidebar widgets, pagination and a comment form that shows new comments on the page.
- Project: Login and Signup Forms Build login and signup forms in Bootstrap 5 with floating labels, validation messages, a password show/hide button and a switch between the two forms. Nothing is sent.
- Project: Portfolio Site Build a personal portfolio with Bootstrap 5: a gallery grid that opens a shared modal, skill progress bars, a contact form with printed output and a dark mode switch.
Practice and Review
- Exercises with Solutions Practice Bootstrap 5.3 with six hands-on exercises covering the grid, utilities, forms, cards, navbars and modals. Every exercise has a runnable solution.
- Bootstrap Interview Questions Bootstrap 5.3 interview questions with short, accurate answers on the grid, breakpoints, utilities, JavaScript plugins, Sass, accessibility and Tailwind.
- Bootstrap Cheat Sheet A compact Bootstrap 5.3 cheat sheet: grid classes, breakpoints, spacing scale, common utilities, components and data attributes, with two live samplers.