Bootstrap Tutorial
Build responsive websites fast with the Bootstrap framework.
Getting started7 lessons
- 1Bootstrap IntroductionBootstrap is the most popular CSS framework for building responsive, mobile first websites.
- 2Bootstrap Get StartedAdd the CDN link and the viewport meta tag.
- 3The Viewport Meta TagBootstrap is mobile first.
- 4ContainersA container centres and pads your content.
- 5BreakpointsBreakpoints are screen widths where the layout changes: xs below 576px, sm 576, md 768, lg.
- 6Theme ColorsBootstrap names colours by meaning: primary, secondary, success, danger, warning, info, li.
- 7Dark Mode and Color ModesBootstrap 5.3 supports light and dark with the data-bs-theme attribute.
Layout8 lessons
- 8Grid System BasicsThe grid has 12 columns.
- 9Column SizesUse .col-6, .col-4 and so on to set widths out of 12.
- 10Auto Layout ColumnsWithout numbers, columns share space.
- 11Gutters and Spacing in RowsGutters are the gaps between columns.
- 12Aligning ColumnsUse align-items-* on a row for vertical alignment and justify-content-* for horizontal.
- 13Offset and Order.offset-md-3 pushes a column right.
- 14Nested Grids and Row ColumnsPut a new .row inside a column to nest the grid.
- 15Bootstrap CSS GridAn optional CSS grid layout lets you use real two dimensional layouts with .grid and .g-co.
Content7 lessons
- 16TypographyHeadings h1 to h6 and the .h1 to .h6 classes share styles.
- 17Text UtilitiesAlign with text-start, text-center and text-end.
- 18Images.img-fluid makes an image scale with its parent.
- 19TablesAdd .table to a table.
- 20Colors and BackgroundsUse text-* for text color, bg-* for background and text-bg-* for matched pairs.
- 21Borders, Rounding and ShadowsUse border, border-top, rounded, rounded-pill and shadow, shadow-sm or shadow-lg to style .
- 22IconsBootstrap Icons is a separate free set of SVG icons.
Components14 lessons
- 23ButtonsAdd .btn plus a variant such as .btn-primary.
- 24Button GroupsWrap related buttons in .btn-group for a joined look, or .btn-group-vertical for a vertica.
- 25AlertsAlerts show feedback messages.
- 26Badges and SpinnersBadges are small labels or counters.
- 27CardsA card is a flexible content box.
- 28NavbarA navbar needs .navbar and .navbar-expand-lg to collapse on small screens.
- 29Nav, Tabs and Pills.nav makes navigation.
- 30DropdownsA dropdown toggles a menu.
- 31ModalsA modal is a dialog over the page.
- 32Accordion and CollapseCollapse hides content.
- 33List Groups.list-group styles lists as a card like stack.
- 34Pagination and BreadcrumbsPagination splits long lists across pages.
- 35Progress Bars.progress is the track and .progress-bar the fill.
- 36Tooltips and PopoversTooltips and popovers use Popper and must be turned on with JavaScript because they are op.
Forms6 lessons
- 37Form ControlsUse .form-label, .form-control and .form-text.
- 38Select, Checks and SwitchesUse .form-select for dropdowns, .form-check with .form-check-input for checkboxes and radi.
- 39Input GroupsInput groups attach text, buttons or icons to an input using .input-group and .input-group.
- 40Form LayoutsPlace fields in the grid for horizontal or multi column forms.
- 41Floating LabelsWrap an input and label in .form-floating and the label floats above the text when the fie.
- 42Form ValidationAdd novalidate and the .was-validated class after a failed submit to show browser validati.
Utilities5 lessons
- 43Spacing: Margin and PaddingClasses follow the pattern property side size.
- 44Display Utilitiesd-none hides, d-block, d-inline and d-flex change display.
- 45Flex UtilitiesBootstrap wraps flexbox in classes: flex-row, flex-column, justify-content-*, align-items-.
- 46Sizing and Positionw-25, w-50, w-100 and h-100 set percentages.
- 47Visibility, Overflow and Ratioinvisible keeps space, visible shows.
Advanced BootstrapPremium9 lessons
- 48Customizing with SassInstall the source, override Sass variables before importing Bootstrap and compile.
- 49CSS VariablesBootstrap 5 exposes CSS variables such as --bs-primary and --bs-body-font-size.
- 50The Utility APIThe utility API in Sass generates classes from a map.
- 51OffcanvasAn offcanvas panel slides in from the edge of the screen for menus or carts.
- 52CarouselA carousel slides through images or content.
- 53Scrollspy and ToastsScrollspy highlights nav links as you scroll.
- 54Using the JavaScript APIEvery plugin has a JavaScript class: Modal, Collapse, Tooltip and more.
- 55AccessibilityUse semantic HTML, alt text, labels, focus styles, enough colour contrast and ARIA attribu.
- 56RTL SupportBootstrap has an RTL build for languages such as Arabic and Hebrew.
Bootstrap in practicePremium8 lessons
- 57Building a Landing PageCombine navbar, hero section, feature cards and a footer.
- 58Dashboard LayoutUse a sidebar column with a main area, cards for stats and responsive tables.
- 59Responsive Images and MediaCombine img-fluid with the picture element and loading="lazy".
- 60Bootstrap Compared With Other OptionsBootstrap gives ready made components and a consistent look quickly.
- 61Performance and Bundle SizeImport only the Sass or JavaScript you need, purge unused CSS, host files yourself or use .
- 62Bootstrap with React, Vue and AngularUse component libraries such as React Bootstrap, BootstrapVue Next or ng-bootstrap.
- 63Bootstrap Best PracticesUse the grid and utilities first, customise with variables, keep custom CSS small, write s.
- 64Next StepsYou can now build responsive layouts with the grid, components, forms and utilities.
Bootstrap layout12 lessons
- 65Containerscontainer is fixed width per breakpoint and container-fluid is full width.
- 66Grid SystemRows hold 12 column units.
- 67Responsive BreakpointsPrefixes sm, md, lg, xl and xxl apply from a width up.
- 68Auto Layout Columnscol without a number shares space equally.
- 69Guttersg-* classes set spacing between columns.
- 70Offsets and Orderoffset moves columns and order reorders them.
- 71Nesting GridsPut a row inside a column for deeper layouts.
- 72Alignment in Gridalign-items and justify-content position columns.
- 73Display Utilitiesd-* controls display per breakpoint.
- 74Flex Utilitiesd-flex plus utilities build flexible rows.
- 75Spacing Utilitiesm and p classes with sides and sizes 0 to 5.
- 76Sizing Utilitiesw-25, w-50, w-100, h-100 and mw-100 size elements.
Typography and color7 lessons
- 77Headings and Displayh1 to h6 and display-1 to display-6 are large headings.
- 78Text UtilitiesAlign, wrap, weight and transform text.
- 79Color Utilitiestext-* and bg-* use theme colors.
- 80Borders and Radiusborder and rounded classes shape boxes.
- 81Shadowsshadow-sm, shadow and shadow-lg add depth.
- 82Link and Opacity UtilitiesControl link underline and opacity.
- 83Position Utilitiesposition-relative, absolute and fixed-top place elements.
Bootstrap components17 lessons
- 84Buttonsbtn plus a color class styles buttons.
- 85Button Groupsbtn-group joins buttons.
- 86Alertsalert plus a color shows messages.
- 87Badgesbadge shows counts and labels.
- 88Cardscard, card-body, card-title and card-text build content boxes.
- 89List Groupslist-group styles lists.
- 90Nav and Tabsnav, nav-tabs and nav-pills build navigation.
- 91Navbarnavbar, navbar-expand-lg and navbar-toggler make responsive menus.
- 92Breadcrumbbreadcrumb shows page location.
- 93Paginationpagination, page-item and page-link build page lists.
- 94Tablestable plus modifiers style tables.
- 95Formsform-control and form-label style inputs.
- 96Checks, Radios and Switchesform-check wraps checkboxes and form-switch makes toggles.
- 97Select and Rangeform-select and form-range style these controls.
- 98Input Groupsinput-group adds text or buttons beside an input.
- 99Form Validation Stylesis-valid, is-invalid and needs-validation show states.
- 100Floating Labelsform-floating puts the label inside the input.
Interactive components11 lessons
- 101Including Bootstrap JSLoad the bundle to power components.
- 102Dropdownsdropdown-toggle and dropdown-menu build menus.
- 103Collapsecollapse hides content that a button toggles.
- 104Accordionaccordion builds collapsible sections.
- 105Modalsmodal shows a dialog.
- 106Tooltips and PopoversThese need JavaScript to be initialised.
- 107Carouselcarousel slides cycle images.
- 108Offcanvasoffcanvas slides a panel from an edge.
- 109Toaststoast shows small notices.
- 110Spinners and Progressspinner-border and progress show loading and completion.
- 111Placeholdersplaceholder-glow shows loading skeletons.
Bootstrap in real pages12 lessons
- 112Project: Hero SectionCombine container, display and buttons.
- 113Project: Pricing CardsThree cards in a responsive row.
- 114Project: Login FormCenter a form with grid and utilities.
- 115Project: Dashboard LayoutSidebar and main area with grid.
- 116Dark Modedata-bs-theme switches color modes.
- 117Bootstrap IconsBootstrap Icons is a separate icon font.
- 118Customising with CSS VariablesOverride CSS variables to restyle components.
- 119Customising with SassOverride Sass variables before importing Bootstrap.
- 120Accessibility TipsUse semantic tags, labels and visually-hidden text.
- 121Responsive Images and Ratiosimg-fluid scales images and ratio keeps aspect.
- 122Sticky FooterUse flex column and mt-auto.
- 123Bootstrap Best PracticesPrefer utilities, keep markup semantic and avoid overriding too much.