2025-04-15 02:26:20 +08:00
<!DOCTYPE html> < html lang = "en" data-bs-theme = "auto" > < head > < meta charset = "UTF-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1" > < meta name = "description" content = "Documentation and examples for Bootstrap typography, including global settings, headings, body text, lists, and more." > < meta name = "author" content = "Mark Otto, Jacob Thornton, and Bootstrap contributors" > < meta name = "generator" content = "Astro v5.6.1" > < meta name = "docsearch:language" content = "en" > < meta name = "docsearch:version" content = "5.3" > < link rel = "canonical" href = "https://getbootstrap.com/docs/5.3/content/typography/" > < link rel = "preconnect" href = "https://AK7KMZKZHQ-dsn.algolia.net" crossorigin > < title > Typography · Bootstrap v5.3< / title > < script src = "/docs/5.3/assets/js/color-modes.js" > < / script > < link rel = "stylesheet" href = "https://cdn.jsdelivr.net/npm/@docsearch/css@3" > < link href = "/docs/5.3/dist/css/bootstrap.min.css" rel = "stylesheet" integrity = "sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" > < link rel = "apple-touch-icon" href = "/docs/5.3/assets/img/favicons/apple-touch-icon.png" sizes = "180x180" > < link rel = "icon" href = "/docs/5.3/assets/img/favicons/favicon-32x32.png" sizes = "32x32" type = "image/png" > < link rel = "icon" href = "/docs/5.3/assets/img/favicons/favicon-16x16.png" sizes = "16x16" type = "image/png" > < link rel = "manifest" href = "/docs/5.3/assets/img/favicons/manifest.json" > < link rel = "mask-icon" href = "/docs/5.3/assets/img/favicons/safari-pinned-tab.svg" color = "#712cf9" > < link rel = "icon" href = "/docs/5.3/assets/img/favicons/favicon.ico" > < meta name = "theme-color" content = "#712cf9" > < meta name = "twitter:card" content = "summary_large_image" > < meta name = "twitter:site" content = "@getbootstrap" > < meta name = "twitter:creator" content = "@getbootstrap" > < meta name = "twitter:title" content = "Typography" > < meta name = "twitter:description" content = "Documentation and examples for Bootstrap typography, including global settings, headings, body text, lists, and more." > < meta name = "twitter:image" content = "https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-social.png" > < meta property = "og:url" content = "https://getbootstrap.com/docs/5.3/content/typography/" > < meta property = "og:title" content = "Typography" > < meta property = "og:description" content = "Documentation and examples for Bootstrap typography, including global settings, headings, body text, lists, and more." > < meta property = "og:type" content = "article" > < meta property = "og:image" content = "https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-social.png" > < meta property = "og:image:type" content = "image/png" > < meta property = "og:image:width" content = "2000" > < meta property = "og:image:height" content = "1000" > < script defer src = "https://cdn.usefathom.com/script.js" data-site = "ITUSEYJG" > < / script > < link rel = "stylesheet" href = "/docs/5.3/assets/_slug_.C9dNs6d9.css" > < / head > < body data-bs-spy = "scroll" data-bs-target = "#TableOfContents" > < div class = "skippy visually-hidden-focusable overflow-hidden" > < div class = "container-xl" > < a class = "d-inline-flex p-2 m-1" href = "#content" > Skip to main content< / a > < a class = "d-none d-md-inline-flex p-2 m-1" href = "#bd-docs-nav" >
Skip to docs navigation
< / a > < / div > < / div > < svg xmlns = "http://www.w3.org/2000/svg" class = "d-none" > < symbol id = "arrow-right" viewBox = "0 0 16 16" > < path fill-rule = "evenodd" d = "M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z" > < / path > < / symbol > < symbol id = "arrow-right-short" viewBox = "0 0 16 16" > < path fill-rule = "evenodd" d = "M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8" > < / path > < / symbol > < symbol id = "book-half" viewBox = "0 0 16 16" > < path d = "M8.5 2.687c.654-.689 1.782-.886 3.112-.752 1.234.124 2.503.523 3.388.893v9.923c-.918-.35-2.107-.692-3.287-.81-1.094-.111-2.278-.039-3.213.492V2.687zM8 1.783C7.015.936 5.587.81 4.287.94c-1.514.153-3.042.672-3.994 1.105A.5.5 0 0 0 0 2.5v11a.5.5 0 0 0 .707.455c.882-.4 2.303-.881 3.68-1.02 1.409-.142 2.59.087 3.223.877a.5.5 0 0 0 .78 0c.633-.79 1.814-1.019 3.222-.877 1.378.139 2.8.62 3.681 1.02A.5.5 0 0 0 16 13.5v-11a.5.5 0 0 0-.293-.455c-.952-.433-2.48-.952-3.994-1.105C10.413.809 8.985.936 8 1.783z" > < / path > < / symbol > < symbol id = "box-seam" viewBox = "0 0 16 16" > < path d = "M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2l-2.218-.887zm3.564 1.426L5.596 5 8 5.961 14.154 3.5l-2.404-.961zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464L7.443.184z" > < / path > < / symbol > < symbol id = "braces" viewBox = "0 0 16 16" > < path d = "M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6zM13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6z" > < / path > < / symbol > < symbol id = "braces-asterisk" viewBox = "0 0 16 16" > < path fill-rule = "evenodd" d = "M1.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C2.25 2 1.49 2.759 1.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6ZM14.886 7.9v.164c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456v-1.3c-1.114 0-1.49-.362-1.49-1.456V4.352C14.51 2.759 13.75 2 12.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6ZM7.5 11.5V9.207l-1.621 1.621-.707-.707L6.792 8.5H4.5v-1h2.293L5.172 5.879l.707-.707L7.5 6.792V4.5h1v2.293l1.621-1.621.707.707L9.208 7.5H11.5v1H9.207l1.621 1.621-.707.707L8.5 9.208V11.5h-1Z" > < / path > < / symbol > < symbol id = "check2" viewBox = "0 0 16 16" > < path d = "M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" > < / path > < / symbol > < symbol id = "chevron-expand" viewBox = "0 0 16 16" > < path fill-rule = "evenodd" d = "M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708zm0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708z" > < / path > < / symbol > < symbol id = "circle-half" viewBox = "0 0 16 16" > < path d = "M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z" > < / path > < / symbol > < symbol id = "clipboard" viewBox = "0 0 16 16" > < path d = "M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" > < / path > < path d = "M9.5 1a . 5 . 5 0 0 1 . 5 . 5
Docs
< / a > < / li > < li class = "nav-item col-6 col-lg-auto" > < a class = "nav-link py-2 px-0 px-lg-2" href = "/docs/5.3/examples/" > Examples < / a > < / li > < li class = "nav-item col-6 col-lg-auto" > < a class = "nav-link py-2 px-0 px-lg-2" href = "https://icons.getbootstrap.com/" target = "_blank" rel = "noopener" > Icons < / a > < / li > < li class = "nav-item col-6 col-lg-auto" > < a class = "nav-link py-2 px-0 px-lg-2" href = "https://themes.getbootstrap.com/" target = "_blank" rel = "noopener" > Themes < / a > < / li > < li class = "nav-item col-6 col-lg-auto" > < a class = "nav-link py-2 px-0 px-lg-2" href = "https://blog.getbootstrap.com/" target = "_blank" rel = "noopener" > Blog < / a > < / li > < / ul > < hr class = "d-lg-none text-white-50" > < ul class = "navbar-nav flex-row flex-wrap ms-md-auto" > < li class = "nav-item col-6 col-lg-auto" > < a class = "nav-link py-2 px-0 px-lg-2 nav-link py-2 px-0 px-lg-2" href = "https://github.com/twbs" target = "_blank" rel = "noopener" > < svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 512 499.36" role = "img" class = "navbar-nav-svg" height = "16" width = "16" > < title > GitHub< / title > < path fill = "currentColor" fill-rule = "evenodd" d = "M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" > < / path > < / svg > < small class = "d-lg-none ms-2" > GitHub< / small > < / a > < / li > < li class = "nav-item col-6 col-lg-auto" > < a class = "nav-link py-2 px-0 px-lg-2 nav-link py-2 px-0 px-lg-2" href = "https://x.com/getbootstrap" target = "_blank" rel = "noopener" > < svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 1200 1227" role = "img" class = "navbar-nav-svg" height = "16" width = "16" > < title > X< / title > < path fill = "currentColor" d = "M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z" > < / path > < / svg > < small class = "d-lg-none ms-2" > X< / small > < / a > < / li > < li class = "nav-item col-6 col-lg-auto" > < a class = "nav-link py-2 px-0 px-lg-2 nav-link py-2 px-0 px-lg-2" href = "https://opencollective.com/bootstrap" target = "_blank" rel = "noopener" > < svg xmlns = "http://www.w3.org/2000/svg" fill = "currentColor" fill-rule = "evenodd" viewBox = "0 0 40 41" role = "img" class = "navbar-nav-svg" height = "16" width = "16" > < title > Open Collective< / title > < path fill-opacity = ".4" d = "M32.8 21c0 2.4-.8 4.9-2 6.9l5.1 5.1c2.5-3.4 4.1-7.6 4.1-12 0-4.6-1.6-8.8-4-12.2L30.7 14c1.2 2 2 4.3 2 7z" > < / path > < path d = "M20 33.7a12.8 12.8 0 0 1 0-25.6c2.6 0 5 .7 7 2.1L32 5a20 20 0 1 0 .1 31.9l-5-5.2a13 13 0 0 1-7 2z" > < / path > < / svg > < small class = "d-lg-none ms-2" > Open Collective< / small > < / a > < / li > < li class = "nav-item py-2 py-lg-1 col-12 col-lg-auto" > < div class = "vr d-none d-lg-flex h-100 mx-lg-2 text-white" > < / div > < hr class = "d-lg-none my-2 text-white-50" > < / li > < li class = "nav-item dropdown" > < button type = "button" class = "btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle" data-bs-toggle = "dropdown" aria-expanded = "false" data-bs-display = "static" > < span class = "d-lg-none" aria-hidden = "true" > Bootstrap< / span > < span class = "visually-hidden" > Bootstrap < / span > v5.3 < span class = "visually-hidden" > (switch to other versions)< / span > < / button > < ul class = "dropdown-menu dropdown-menu-end" > < li > < h6 class = "dropdown-header" > v5 releases< / h6 > < / li > < li > < a class = "dropdown-item d-flex align-items-center justify-content-between active" aria-current = "true" href = "/do
Latest (5.3.x)
< svg class = "bi" aria-hidden = "true" > < use xlink:href = "#check2" > < / use > < / svg > < / a > < / li > < li > < a class = "dropdown-item" href = "https://getbootstrap.com/docs/5.2/content/typography/" >
v5.2.3
< / a > < / li > < li > < a class = "dropdown-item" href = "https://getbootstrap.com/docs/5.1/content/typography/" >
v5.1.3
< / a > < / li > < li > < a class = "dropdown-item" href = "https://getbootstrap.com/docs/5.0/content/typography/" >
v5.0.2
< / a > < / li > < li > < hr class = "dropdown-divider" > < / li > < li > < h6 class = "dropdown-header" > Previous releases< / h6 > < / li > < li > < a class = "dropdown-item" href = "https://getbootstrap.com/docs/4.6/" > v4.6.x< / a > < / li > < li > < a class = "dropdown-item" href = "https://getbootstrap.com/docs/3.4/" > v3.4.1< / a > < / li > < li > < a class = "dropdown-item" href = "https://getbootstrap.com/2.3.2/" > v2.3.2< / a > < / li > < li > < hr class = "dropdown-divider" > < / li > < li > < a class = "dropdown-item" href = "/docs/versions/" > All versions< / a > < / li > < / ul > < / li > < li class = "nav-item py-2 py-lg-1 col-12 col-lg-auto" > < div class = "vr d-none d-lg-flex h-100 mx-lg-2 text-white" > < / div > < hr class = "d-lg-none my-2 text-white-50" > < / li > < li class = "nav-item dropdown" > < button class = "btn btn-link nav-link px-0 px-lg-2 py-2 dropdown-toggle d-flex align-items-center" id = "bd-theme" type = "button" aria-expanded = "false" data-bs-toggle = "dropdown" data-bs-display = "static" aria-label = "Toggle theme (auto)" > < svg class = "bi my-1 theme-icon-active" aria-hidden = "true" > < use href = "#circle-half" > < / use > < / svg > < span class = "d-lg-none ms-2" id = "bd-theme-text" > Toggle theme< / span > < / button > < ul class = "dropdown-menu dropdown-menu-end" aria-labelledby = "bd-theme-text" > < li > < button type = "button" class = "dropdown-item d-flex align-items-center" data-bs-theme-value = "light" aria-pressed = "false" > < svg class = "bi me-2 opacity-50" aria-hidden = "true" > < use href = "#sun-fill" > < / use > < / svg >
Light
< svg class = "bi ms-auto d-none" aria-hidden = "true" > < use href = "#check2" > < / use > < / svg > < / button > < / li > < li > < button type = "button" class = "dropdown-item d-flex align-items-center" data-bs-theme-value = "dark" aria-pressed = "false" > < svg class = "bi me-2 opacity-50" aria-hidden = "true" > < use href = "#moon-stars-fill" > < / use > < / svg >
Dark
< svg class = "bi ms-auto d-none" aria-hidden = "true" > < use href = "#check2" > < / use > < / svg > < / button > < / li > < li > < button type = "button" class = "dropdown-item d-flex align-items-center active" data-bs-theme-value = "auto" aria-pressed = "true" > < svg class = "bi me-2 opacity-50" aria-hidden = "true" > < use href = "#circle-half" > < / use > < / svg >
Auto
< svg class = "bi ms-auto d-none" aria-hidden = "true" > < use href = "#check2" > < / use > < / svg > < / button > < / li > < / ul > < / li > < / ul > < / div > < / div > < / nav > < / header > < div class = "container-xxl bd-gutter mt-3 my-md-4 bd-layout" > < aside class = "bd-sidebar" > < div class = "offcanvas-lg offcanvas-start" tabindex = "-1" id = "bdSidebar" aria-labelledby = "bdSidebarOffcanvasLabel" > < div class = "offcanvas-header border-bottom" > < h5 class = "offcanvas-title" id = "bdSidebarOffcanvasLabel" > Browse docs< / h5 > < button type = "button" class = "btn-close" data-bs-dismiss = "offcanvas" aria-label = "Close" data-bs-target = "#bdSidebar" > < / button > < / div > < div class = "offcanvas-body" > < nav class = "bd-links w-100" id = "bd-docs-nav" aria-label = "Docs navigation" > < ul class = "bd-links-nav list-unstyled mb-0 pb-3 pb-md-2 pe-lg-2" > < li class = "bd-links-group py-2" > < strong class = "bd-links-heading d-flex w-100 align-items-center fw-semibold" > < svg class = "bi me-2" style = "color: var(--bs-indigo);" aria-hidden = "true" > < use xlink:href = "#book-half" > < / use > < / svg > Getting started < / strong > < ul class = "list-unstyled fw-normal pb-2 small" > < li > < a href = "/docs/5.3/getting-started/introduction" class = "bd-links-link d-inline-block rounded" > Introduction < / a > < / li > < li > < a href = "/docs/5.3/getting-started/download" class = "bd-links-link d-inline-block rounded" > Download < / a > < / li > < li > < a href = "/docs/5.3/getting-started/contents" class = "bd-links-link d-inline-block rounded" > Contents < / a > < / li > < li > < a href = "/docs/5.3/getting-started/browsers-devices" class = "bd-links-link d-inline-block rounded" > Browsers & devices < / a > < / li > < li > < a href = "/docs/5.3/getting-started/javascript" class = "bd-links-link d-inline-block rounded" > JavaScript < / a > < / li > < li > < a href = "/docs/5.3/getting-started/webpack" class = "bd-links-link d-inline-block rounded" > Webpack < / a > < / li > < li > < a href = "/docs/5.3/getting-started/parcel" class = "bd-links-link d-inline-block rounded" > Parcel < / a > < / li > < li > < a href = "/docs/5.3/getting-started/vite" class = "bd-links-link d-inline-block rounded" > Vite < / a > < / li > < li > < a href = "/docs/5.3/getting-started/accessibility" class = "bd-links-link d-inline-block rounded" > Accessibility < / a > < / li > < li > < a href = "/docs/5.3/getting-started/rfs" class = "bd-links-link d-inline-block rounded" > RFS < / a > < / li > < li > < a href = "/docs/5.3/getting-started/rtl" class = "bd-links-link d-inline-block rounded" > RTL < / a > < / li > < li > < a href = "/docs/5.3/getting-started/contribute" class = "bd-links-link d-inline-block rounded" > Contribute < / a > < / li > < / ul > < / li > < li class = "bd-links-group py-2" > < strong class = "bd-links-heading d-flex w-100 align-items-center fw-semibold" > < svg class = "bi me-2" style = "color: var(--bs-pink);" aria-hidden = "true" > < use xlink:href = "#palette2" > < / use > < / svg > Customize < / strong > < ul class = "list-unstyled fw-normal pb-2 small" > < li > < a href = "/docs/5.3/customize/overview" class = "bd-links-link d-inline-block rounded" > Overview < / a > < / li > < li > < a href = "/docs/5.3/customize/sass" class = "bd-links-link d-inline-block rounded" > Sass < / a > < / li > < li > < a href = "/docs/5.3/customize/options" class = "bd-links-link d-inline-block rounded" > Options < / a > < / li > < li > < a href = "/docs/5.3/customize/color" class = "bd-links-link d-inline-block rounded" > Color < / a > < / li > < li > < a href = "/docs/5.3/customize/color-modes" class = "bd-links-link d-inline-block rounded" > Color modes < / a > < / li > < li > < a href = "/docs/5.3/customize/components" class = "bd-links-link d-inline-block rounded" > Components < / a > < / li > < li > < a href = "/docs/5.3/customize/css-variables" class = "bd-links-link d-inline-block rounded" > CSS variables < / a > < / li > < li > < a href = "/docs/5.3/customize/optimize" class = "bd-links-link d-inline-block rounded" > Optimize < / a > < / li > < / ul > < / li > < li class = "bd-links-group py-2" > < strong class = "bd-links-heading d-flex w-100 align-items-center fw-semibold" > < svg class = "bi me-2" style = "color: var(--bs-teal);" aria-hidden = "true" > < use xlink:href = "#grid-fill" > < / use > < / svg > Layout < / strong > < ul class = "list-unstyled fw-normal pb-2 small" > < li > < a href = "/docs/5.3/layout/breakpoints" class = "bd-links-link d-inline-block rounded" > Breakpoints < / a > < / li > < li > < a href = "/docs/5.3/layou
View on GitHub
< / a > < / div > < h1 class = "bd-title mb-0" id = "content" > Typography< / h1 > < / div > < div class = "bd-subtitle" > < p > Documentation and examples for Bootstrap typography, including global settings, headings, body text, lists, and more.< / p >
< / div > < script async src = "https://cdn.carbonads.com/carbon.js?serve=CKYIKKJL&placement=getbootstrapcom" id = "_carbonads_js" > < / script > < / div > < div class = "bd-toc mt-3 mb-5 my-lg-0 mb-lg-5 px-sm-1 text-body-secondary" > < button class = "btn btn-link p-md-0 mb-2 mb-md-0 text-decoration-none bd-toc-toggle d-md-none" type = "button" data-bs-toggle = "collapse" data-bs-target = "#tocContents" aria-expanded = "false" aria-controls = "tocContents" >
On this page
< svg class = "bi d-md-none ms-2" aria-hidden = "true" > < use xlink:href = "#chevron-expand" > < / use > < / svg > < / button > < strong class = "d-none d-md-block h6 my-2 ms-3" > On this page< / strong > < hr class = "d-none d-md-block my-2 ms-3" > < div class = "collapse bd-toc-collapse" id = "tocContents" > < nav id = "TableOfContents" > < ul > < li > < a href = "#global-settings" > Global settings< / a > < / li > < li > < a href = "#headings" > Headings< / a > < ul > < li > < a href = "#customizing-headings" > Customizing headings< / a > < / li > < / ul > < / li > < li > < a href = "#display-headings" > Display headings< / a > < / li > < li > < a href = "#lead" > Lead< / a > < / li > < li > < a href = "#inline-text-elements" > Inline text elements< / a > < / li > < li > < a href = "#text-utilities" > Text utilities< / a > < / li > < li > < a href = "#abbreviations" > Abbreviations< / a > < / li > < li > < a href = "#blockquotes" > Blockquotes< / a > < ul > < li > < a href = "#naming-a-source" > Naming a source< / a > < / li > < li > < a href = "#alignment" > Alignment< / a > < / li > < / ul > < / li > < li > < a href = "#lists" > Lists< / a > < ul > < li > < a href = "#unstyled" > Unstyled< / a > < / li > < li > < a href = "#inline" > Inline< / a > < / li > < li > < a href = "#description-list-alignment" > Description list alignment< / a > < / li > < / ul > < / li > < li > < a href = "#responsive-font-sizes" > Responsive font sizes< / a > < / li > < li > < a href = "#css" > CSS< / a > < ul > < li > < a href = "#sass-variables" > Sass variables< / a > < / li > < li > < a href = "#sass-mixins" > Sass mixins< / a > < / li > < / ul > < / li > < / ul > < / nav > < / div > < / div > < div class = "bd-content ps-lg-2" > < h2 id = "global-settings" > Global settings< a class = "anchor-link" href = "#global-settings" > < / a > < / h2 >
< p > Bootstrap sets basic global display, typography, and link styles. When more control is needed, check out the < a href = "/docs/5.3/utilities/text" > textual utility classes< / a > .< / p >
< ul >
< li > Use a < a href = "/docs/5.3/content/reboot#native-font-stack" > native font stack< / a > that selects the best < code > font-family< / code > for each OS and device.< / li >
< li > For a more inclusive and accessible type scale, we use the browser’ s default root < code > font-size< / code > (typically 16px) so visitors can customize their browser defaults as needed.< / li >
< li > Use the < code > $font-family-base< / code > , < code > $font-size-base< / code > , and < code > $line-height-base< / code > attributes as our typographic base applied to the < code > < body> < / code > .< / li >
< li > Set the global link color via < code > $link-color< / code > .< / li >
< li > Use < code > $body-bg< / code > to set a < code > background-color< / code > on the < code > < body> < / code > (< code > #fff< / code > by default).< / li >
< / ul >
< p > These styles can be found within < code > _reboot.scss< / code > , and the global variables are defined in < code > _variables.scss< / code > . Make sure to set < code > $font-size-base< / code > in < code > rem< / code > .< / p >
< h2 id = "headings" > Headings< a class = "anchor-link" href = "#headings" > < / a > < / h2 >
< p > All HTML headings, < code > < h1> < / code > through < code > < h6> < / code > , are available.< / p >
< div class = "table-responsive" >
2022-12-25 00:43:04 +08:00
2025-04-04 00:14:43 +08:00
2022-12-25 00:43:04 +08:00
2025-04-04 00:14:43 +08:00
2022-12-25 00:43:04 +08:00
2025-04-15 02:26:20 +08:00
< table class = "table" > < thead > < tr > < th > Heading< / th > < th > Example< / th > < / tr > < / thead > < tbody > < tr > < td > < code > < h1> < /h1> < / code > < / td > < td > < span class = "h1" > h1. Bootstrap heading< / span > < / td > < / tr > < tr > < td > < code > < h2> < /h2> < / code > < / td > < td > < span class = "h2" > h2. Bootstrap heading< / span > < / td > < / tr > < tr > < td > < code > < h3> < /h3> < / code > < / td > < td > < span class = "h3" > h3. Bootstrap heading< / span > < / td > < / tr > < tr > < td > < code > < h4> < /h4> < / code > < / td > < td > < span class = "h4" > h4. Bootstrap heading< / span > < / td > < / tr > < tr > < td > < code > < h5> < /h5> < / code > < / td > < td > < span class = "h5" > h5. Bootstrap heading< / span > < / td > < / tr > < tr > < td > < code > < h6> < /h6> < / code > < / td > < td > < span class = "h6" > h6. Bootstrap heading< / span > < / td > < / tr > < / tbody > < / table > < / div >
< script type = "module" src = "/docs/5.3/assets/Code.astro_astro_type_script_index_0_lang.5BTJN8ix.js" > < / script > < div class = "bd-code-snippet" > < div class = "bd-clipboard" > < button type = "button" class = "btn-clipboard" > < svg class = "bi" role = "img" aria-label = "Copy" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < div class = "highlight" > < pre class = "language-html" > < code is:raw class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h1< / span > < span class = "token punctuation" > > < / span > < / span > h1. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h1< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h2< / span > < span class = "token punctuation" > > < / span > < / span > h2. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h2< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h3< / span > < span class = "token punctuation" > > < / span > < / span > h3. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h3< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h4< / span > < span class = "token punctuation" > > < / span > < / span > h4. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h4< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h5< / span > < span class = "token punctuation" > > < / span > < / span > h5. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h5< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h6< / span > < span class = "token punctuation" > > < / span > < / span > h6. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h6< / span > < span class = "token punctuation" > > < / span > < / span >
< / code > < / pre > < / div > < / div >
< p > < code > .h1< / code > through < code > .h6< / code > classes are also available, for when you want to match the font styling of a heading but cannot use the associated HTML element.< / p >
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < p class = "h1" > h1. Bootstrap heading< / p >
2022-12-25 00:43:04 +08:00
< p class = "h2" > h2. Bootstrap heading< / p >
< p class = "h3" > h3. Bootstrap heading< / p >
< p class = "h4" > h4. Bootstrap heading< / p >
< p class = "h5" > h5. Bootstrap heading< / p >
2025-04-15 02:26:20 +08:00
< p class = "h6" > h6. Bootstrap heading< / p > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > h1< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > h1. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > h2< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > h2. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > h3< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > h3. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > h4< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > h4. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > h5< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > h5. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > h6< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > h6. Bootstrap heading< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h3 id = "customizing-headings" > Customizing headings< a class = "anchor-link" href = "#customizing-headings" > < / a > < / h3 >
2022-12-25 00:43:04 +08:00
< p > Use the included utility classes to recreate the small secondary heading text from Bootstrap 3.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < h3 >
2022-12-25 00:43:04 +08:00
Fancy display heading
2023-03-24 22:37:29 +08:00
< small class = "text-body-secondary" > With faded secondary text< / small >
2025-04-15 02:26:20 +08:00
< / h3 > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h3< / span > < span class = "token punctuation" > >< / span > < / span >
Fancy display heading
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > small< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > text-body-secondary< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > With faded secondary text< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > small< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h3< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h2 id = "display-headings" > Display headings< a class = "anchor-link" href = "#display-headings" > < / a > < / h2 >
2022-12-25 00:43:04 +08:00
< p > Traditional heading elements are designed to work best in the meat of your page content. When you need a heading to stand out, consider using a < strong > display heading< / strong > —a larger, slightly more opinionated heading style.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example" > < div class = "display-1 pb-3 mb-3 border-bottom" > Display 1< / div > < div class = "display-2 pb-3 mb-3 border-bottom" > Display 2< / div > < div class = "display-3 pb-3 mb-3 border-bottom" > Display 3< / div > < div class = "display-4 pb-3 mb-3 border-bottom" > Display 4< / div > < div class = "display-5 pb-3 mb-3 border-bottom" > Display 5< / div > < div class = "display-6" > Display 6< / div > < / div >
< div class = "bd-code-snippet" > < div class = "bd-clipboard" > < button type = "button" class = "btn-clipboard" > < svg class = "bi" role = "img" aria-label = "Copy" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < div class = "highlight" > < pre class = "language-html" > < code is:raw class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h1< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > " < / span > display-1< span class = "token punctuation" > " < / span > < / span > < span class = "token punctuation" > > < / span > < / span > Display 1< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h1< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h1< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > " < / span > display-2< span class = "token punctuation" > " < / span > < / span > < span class = "token punctuation" > > < / span > < / span > Display 2< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h1< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h1< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > " < / span > display-3< span class = "token punctuation" > " < / span > < / span > < span class = "token punctuation" > > < / span > < / span > Display 3< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h1< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h1< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > " < / span > display-4< span class = "token punctuation" > " < / span > < / span > < span class = "token punctuation" > > < / span > < / span > Display 4< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h1< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h1< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > " < / span > display-5< span class = "token punctuation" > " < / span > < / span > < span class = "token punctuation" > > < / span > < / span > Display 5< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h1< / span > < span class = "token punctuation" > > < / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > h1< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > " < / span > display-6< span class = "token punctuation" > " < / span > < / span > < span class = "token punctuation" > > < / span > < / span > Display 6< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > h1< / span > < span class = "token punctuation" > > < / span > < / span >
< / code > < / pre > < / div > < / div >
< p > Display headings are configured via the < code > $display-font-sizes< / code > Sass map and two variables, < code > $display-font-weight< / code > and < code > $display-line-height< / code > .< / p >
2022-12-25 00:43:04 +08:00
< p > Display headings are customizable via two variables, < code > $display-font-family< / code > and < code > $display-font-style< / code > .< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-code-snippet bd-example-snippet bd-file-ref" > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-bottom" > < a class = "font-monospace link-secondary link-underline-secondary link-underline-opacity-0 link-underline-opacity-100-hover small" href = "https://github.com/twbs/bootstrap/blob/v5.3.5/scss/_variables.scss" > scss/_variables.scss < / a > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-scss" > < code class = "language-scss" > < span class = "token property" > < span class = "token variable" > $display-font-sizes< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token punctuation" > (< / span >
< span class = "token property" > 1< / span > < span class = "token punctuation" > :< / span > 5rem< span class = "token punctuation" > ,< / span >
< span class = "token property" > 2< / span > < span class = "token punctuation" > :< / span > 4.5rem< span class = "token punctuation" > ,< / span >
< span class = "token property" > 3< / span > < span class = "token punctuation" > :< / span > 4rem< span class = "token punctuation" > ,< / span >
< span class = "token property" > 4< / span > < span class = "token punctuation" > :< / span > 3.5rem< span class = "token punctuation" > ,< / span >
< span class = "token property" > 5< / span > < span class = "token punctuation" > :< / span > 3rem< span class = "token punctuation" > ,< / span >
< span class = "token property" > 6< / span > < span class = "token punctuation" > :< / span > 2.5rem
< span class = "token punctuation" > )< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $display-font-family< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $display-font-style< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $display-font-weight< / span > < / span > < span class = "token punctuation" > :< / span > 300< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $display-line-height< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $headings-line-height< / span > < span class = "token punctuation" > ;< / span >
< / code > < / pre > < / div > < / div >
< h2 id = "lead" > Lead< a class = "anchor-link" href = "#lead" > < / a > < / h2 >
2022-12-25 00:43:04 +08:00
< p > Make a paragraph stand out by adding < code > .lead< / code > .< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < p class = "lead" >
2022-12-25 00:43:04 +08:00
This is a lead paragraph. It stands out from regular paragraphs.
2025-04-15 02:26:20 +08:00
< / p > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > lead< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
This is a lead paragraph. It stands out from regular paragraphs.
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h2 id = "inline-text-elements" > Inline text elements< a class = "anchor-link" href = "#inline-text-elements" > < / a > < / h2 >
2022-12-25 00:43:04 +08:00
< p > Styling for common inline HTML5 elements.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < p > You can use the mark tag to < mark > highlight< / mark > text.< / p >
2022-12-25 00:43:04 +08:00
< p > < del > This line of text is meant to be treated as deleted text.< / del > < / p >
< p > < s > This line of text is meant to be treated as no longer accurate.< / s > < / p >
< p > < ins > This line of text is meant to be treated as an addition to the document.< / ins > < / p >
< p > < u > This line of text will render as underlined.< / u > < / p >
< p > < small > This line of text is meant to be treated as fine print.< / small > < / p >
< p > < strong > This line rendered as bold text.< / strong > < / p >
2025-04-15 02:26:20 +08:00
< p > < em > This line rendered as italicized text.< / em > < / p > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > You can use the mark tag to < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > mark< / span > < span class = "token punctuation" > >< / span > < / span > highlight< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > mark< / span > < span class = "token punctuation" > >< / span > < / span > text.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > del< / span > < span class = "token punctuation" > >< / span > < / span > This line of text is meant to be treated as deleted text.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > del< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > s< / span > < span class = "token punctuation" > >< / span > < / span > This line of text is meant to be treated as no longer accurate.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > s< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > ins< / span > < span class = "token punctuation" > >< / span > < / span > This line of text is meant to be treated as an addition to the document.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > ins< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > u< / span > < span class = "token punctuation" > >< / span > < / span > This line of text will render as underlined.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > u< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > small< / span > < span class = "token punctuation" > >< / span > < / span > This line of text is meant to be treated as fine print.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > small< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > strong< / span > < span class = "token punctuation" > >< / span > < / span > This line rendered as bold text.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > strong< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > em< / span > < span class = "token punctuation" > >< / span > < / span > This line rendered as italicized text.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > em< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
2022-12-25 00:43:04 +08:00
< p > Beware that those tags should be used for semantic purpose:< / p >
< ul >
< li > < code > < mark> < / code > represents text which is marked or highlighted for reference or notation purposes.< / li >
< li > < code > < small> < / code > represents side-comments and small print, like copyright and legal text.< / li >
< li > < code > < s> < / code > represents element that are no longer relevant or no longer accurate.< / li >
< li > < code > < u> < / code > represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation.< / li >
< / ul >
< p > If you want to style your text, you should use the following classes instead:< / p >
< ul >
< li > < code > .mark< / code > will apply the same styles as < code > < mark> < / code > .< / li >
< li > < code > .small< / code > will apply the same styles as < code > < small> < / code > .< / li >
< li > < code > .text-decoration-underline< / code > will apply the same styles as < code > < u> < / code > .< / li >
< li > < code > .text-decoration-line-through< / code > will apply the same styles as < code > < s> < / code > .< / li >
< / ul >
< p > While not shown above, feel free to use < code > < b> < / code > and < code > < i> < / code > in HTML5. < code > < b> < / code > is meant to highlight words or phrases without conveying additional importance, while < code > < i> < / code > is mostly for voice, technical terms, etc.< / p >
2025-04-15 02:26:20 +08:00
< h2 id = "text-utilities" > Text utilities< a class = "anchor-link" href = "#text-utilities" > < / a > < / h2 >
< p > Change text alignment, transform, style, weight, line-height, decoration and color with our < a href = "/docs/5.3/utilities/text" > text utilities< / a > and < a href = "/docs/5.3/utilities/colors" > color utilities< / a > .< / p >
< h2 id = "abbreviations" > Abbreviations< a class = "anchor-link" href = "#abbreviations" > < / a > < / h2 >
< p > Stylized implementation of HTML’ s < code > < abbr> < / code > element for abbreviations and acronyms to show the expanded version on hover. Abbreviations have a default underline and gain a help cursor to provide additional context on hover and to users of assistive technologies.< / p >
2022-12-25 00:43:04 +08:00
< p > Add < code > .initialism< / code > to an abbreviation for a slightly smaller font-size.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < p > < abbr title = "attribute" > attr< / abbr > < / p >
< p > < abbr title = "HyperText Markup Language" class = "initialism" > HTML< / abbr > < / p > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > abbr< / span > < span class = "token attr-name" > title< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > attribute< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > attr< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > abbr< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > abbr< / span > < span class = "token attr-name" > title< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > HyperText Markup Language< span class = "token punctuation" > "< / span > < / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > initialism< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > HTML< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > abbr< / span > < span class = "token punctuation" > >< / span > < / span > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h2 id = "blockquotes" > Blockquotes< a class = "anchor-link" href = "#blockquotes" > < / a > < / h2 >
2022-12-25 00:43:04 +08:00
< p > For quoting blocks of content from another source within your document. Wrap < code > < blockquote class=" blockquote" > < / code > around any HTML as the quote.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < blockquote class = "blockquote" >
2022-12-25 00:43:04 +08:00
< p > A well-known quote, contained in a blockquote element.< / p >
2025-04-15 02:26:20 +08:00
< / blockquote > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > blockquote< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > blockquote< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > A well-known quote, contained in a blockquote element.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > blockquote< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h3 id = "naming-a-source" > Naming a source< a class = "anchor-link" href = "#naming-a-source" > < / a > < / h3 >
2022-12-25 00:43:04 +08:00
< p > The HTML spec requires that blockquote attribution be placed outside the < code > < blockquote> < / code > . When providing attribution, wrap your < code > < blockquote> < / code > in a < code > < figure> < / code > and use a < code > < figcaption> < / code > or a block level element (e.g., < code > < p> < / code > ) with the < code > .blockquote-footer< / code > class. Be sure to wrap the name of the source work in < code > < cite> < / code > as well.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < figure >
2022-12-25 00:43:04 +08:00
< blockquote class = "blockquote" >
< p > A well-known quote, contained in a blockquote element.< / p >
< / blockquote >
< figcaption class = "blockquote-footer" >
Someone famous in < cite title = "Source Title" > Source Title< / cite >
< / figcaption >
2025-04-15 02:26:20 +08:00
< / figure > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > figure< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > blockquote< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > blockquote< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > A well-known quote, contained in a blockquote element.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > blockquote< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > figcaption< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > blockquote-footer< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
Someone famous in < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > cite< / span > < span class = "token attr-name" > title< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > Source Title< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Source Title< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > cite< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > figcaption< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > figure< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h3 id = "alignment" > Alignment< a class = "anchor-link" href = "#alignment" > < / a > < / h3 >
2022-12-25 00:43:04 +08:00
< p > Use text utilities as needed to change the alignment of your blockquote.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < figure class = "text-center" >
2022-12-25 00:43:04 +08:00
< blockquote class = "blockquote" >
< p > A well-known quote, contained in a blockquote element.< / p >
< / blockquote >
< figcaption class = "blockquote-footer" >
Someone famous in < cite title = "Source Title" > Source Title< / cite >
< / figcaption >
2025-04-15 02:26:20 +08:00
< / figure > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > figure< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > text-center< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > blockquote< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > blockquote< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > A well-known quote, contained in a blockquote element.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > blockquote< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > figcaption< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > blockquote-footer< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
Someone famous in < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > cite< / span > < span class = "token attr-name" > title< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > Source Title< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Source Title< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > cite< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > figcaption< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > figure< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < figure class = "text-end" >
2022-12-25 00:43:04 +08:00
< blockquote class = "blockquote" >
< p > A well-known quote, contained in a blockquote element.< / p >
< / blockquote >
< figcaption class = "blockquote-footer" >
Someone famous in < cite title = "Source Title" > Source Title< / cite >
< / figcaption >
2025-04-15 02:26:20 +08:00
< / figure > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > figure< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > text-end< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > blockquote< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > blockquote< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > A well-known quote, contained in a blockquote element.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > blockquote< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > figcaption< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > blockquote-footer< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
Someone famous in < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > cite< / span > < span class = "token attr-name" > title< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > Source Title< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Source Title< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > cite< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > figcaption< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > figure< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h2 id = "lists" > Lists< a class = "anchor-link" href = "#lists" > < / a > < / h2 >
< h3 id = "unstyled" > Unstyled< a class = "anchor-link" href = "#unstyled" > < / a > < / h3 >
2022-12-25 00:43:04 +08:00
< p > Remove the default < code > list-style< / code > and left margin on list items (immediate children only). < strong > This only applies to immediate children list items< / strong > , meaning you will need to add the class for any nested lists as well.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < ul class = "list-unstyled" >
2022-12-25 00:43:04 +08:00
< li > This is a list.< / li >
< li > It appears completely unstyled.< / li >
2025-04-15 02:26:20 +08:00
< li > Structurally, it’ s still a list.< / li >
2022-12-25 00:43:04 +08:00
< li > However, this style only applies to immediate child elements.< / li >
< li > Nested lists:
< ul >
< li > are unaffected by this style< / li >
< li > will still show a bullet< / li >
< li > and have appropriate left margin< / li >
< / ul >
< / li >
< li > This may still come in handy in some situations.< / li >
2025-04-15 02:26:20 +08:00
< / ul > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > ul< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > list-unstyled< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > This is a list.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > It appears completely unstyled.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > Structurally, it’ s still a list.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > However, this style only applies to immediate child elements.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > Nested lists:
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > ul< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > are unaffected by this style< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > will still show a bullet< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > and have appropriate left margin< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > ul< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token punctuation" > >< / span > < / span > This may still come in handy in some situations.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > ul< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h3 id = "inline" > Inline< a class = "anchor-link" href = "#inline" > < / a > < / h3 >
< p > Remove a list’ s bullets and apply some light < code > margin< / code > with a combination of two classes, < code > .list-inline< / code > and < code > .list-inline-item< / code > .< / p >
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < ul class = "list-inline" >
2022-12-25 00:43:04 +08:00
< li class = "list-inline-item" > This is a list item.< / li >
< li class = "list-inline-item" > And another one.< / li >
2025-04-15 02:26:20 +08:00
< li class = "list-inline-item" > But they’ re displayed inline.< / li >
< / ul > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > ul< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > list-inline< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > list-inline-item< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > This is a list item.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > list-inline-item< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > And another one.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > li< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > list-inline-item< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > But they’ re displayed inline.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > li< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > ul< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h3 id = "description-list-alignment" > Description list alignment< a class = "anchor-link" href = "#description-list-alignment" > < / a > < / h3 >
< p > Align terms and descriptions horizontally by using our grid system’ s predefined classes (or semantic mixins). For longer terms, you can optionally add a < code > .text-truncate< / code > class to truncate the text with an ellipsis.< / p >
< div class = "bd-example-snippet bd-code-snippet" > < div class = "bd-example m-0 border-0" > < dl class = "row" >
2022-12-25 00:43:04 +08:00
< dt class = "col-sm-3" > Description lists< / dt >
< dd class = "col-sm-9" > A description list is perfect for defining terms.< / dd >
< dt class = "col-sm-3" > Term< / dt >
< dd class = "col-sm-9" >
< p > Definition for the term.< / p >
< p > And some more placeholder definition text.< / p >
< / dd >
< dt class = "col-sm-3" > Another term< / dt >
< dd class = "col-sm-9" > This definition is short, so no extra paragraphs or anything.< / dd >
< dt class = "col-sm-3 text-truncate" > Truncated term is truncated< / dt >
< dd class = "col-sm-9" > This can be useful when space is tight. Adds an ellipsis at the end.< / dd >
< dt class = "col-sm-3" > Nesting< / dt >
< dd class = "col-sm-9" >
< dl class = "row" >
< dt class = "col-sm-4" > Nested definition list< / dt >
< dd class = "col-sm-8" > I heard you like definition lists. Let me put a definition list inside your definition list.< / dd >
< / dl >
< / dd >
2025-04-15 02:26:20 +08:00
< / dl > < / div > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-0 border-top border-bottom" > < small class = "font-monospace text-body-secondary text-uppercase" > html< / small > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-edit text-nowrap" title = "Try it on StackBlitz" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#lightning-charge-fill" > < / use > < / svg > < / button > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-html" > < code class = "language-html" > < span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dl< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > row< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dt< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-3< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Description lists< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dt< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dd< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-9< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > A description list is perfect for defining terms.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dd< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dt< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-3< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Term< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dt< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dd< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-9< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > Definition for the term.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > p< / span > < span class = "token punctuation" > >< / span > < / span > And some more placeholder definition text.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > p< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dd< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dt< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-3< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Another term< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dt< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dd< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-9< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > This definition is short, so no extra paragraphs or anything.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dd< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dt< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-3 text-truncate< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Truncated term is truncated< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dt< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dd< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-9< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > This can be useful when space is tight. Adds an ellipsis at the end.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dd< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dt< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-3< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Nesting< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dt< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dd< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-9< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dl< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > row< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dt< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-4< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > Nested definition list< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dt< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < < / span > dd< / span > < span class = "token attr-name" > class< / span > < span class = "token attr-value" > < span class = "token punctuation attr-equals" > =< / span > < span class = "token punctuation" > "< / span > col-sm-8< span class = "token punctuation" > "< / span > < / span > < span class = "token punctuation" > >< / span > < / span > I heard you like definition lists. Let me put a definition list inside your definition list.< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dd< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dl< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dd< / span > < span class = "token punctuation" > >< / span > < / span >
< span class = "token tag" > < span class = "token tag" > < span class = "token punctuation" > < /< / span > dl< / span > < span class = "token punctuation" > >< / span > < / span > < / code > < / pre > < / div > < / div >
< h2 id = "responsive-font-sizes" > Responsive font sizes< a class = "anchor-link" href = "#responsive-font-sizes" > < / a > < / h2 >
< p > In Bootstrap 5, we’ ve enabled responsive font sizes by default, allowing text to scale more naturally across device and viewport sizes. Have a look at the < a href = "/docs/5.3/getting-started/rfs" > RFS page< / a > to find out how this works.< / p >
< h2 id = "css" > CSS< a class = "anchor-link" href = "#css" > < / a > < / h2 >
< h3 id = "sass-variables" > Sass variables< a class = "anchor-link" href = "#sass-variables" > < / a > < / h3 >
2022-12-25 00:43:04 +08:00
< p > Headings have some dedicated variables for sizing and spacing.< / p >
2025-04-15 02:26:20 +08:00
< div class = "bd-code-snippet bd-example-snippet bd-file-ref" > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-bottom" > < a class = "font-monospace link-secondary link-underline-secondary link-underline-opacity-0 link-underline-opacity-100-hover small" href = "https://github.com/twbs/bootstrap/blob/v5.3.5/scss/_variables.scss" > scss/_variables.scss < / a > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-scss" > < code class = "language-scss" > < span class = "token property" > < span class = "token variable" > $headings-margin-bottom< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $spacer< / span > < span class = "token operator" > *< / span > .5< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $headings-font-family< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $headings-font-style< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $headings-font-weight< / span > < / span > < span class = "token punctuation" > :< / span > 500< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $headings-line-height< / span > < / span > < span class = "token punctuation" > :< / span > 1.2< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $headings-color< / span > < / span > < span class = "token punctuation" > :< / span > inherit< span class = "token punctuation" > ;< / span >
< / code > < / pre > < / div > < / div >
< p > Miscellaneous typography elements covered here and in < a href = "/docs/5.3/content/reboot" > Reboot< / a > also have dedicated variables.< / p >
< div class = "bd-code-snippet bd-example-snippet bd-file-ref" > < div class = "d-flex align-items-center highlight-toolbar ps-3 pe-2 py-1 border-bottom" > < a class = "font-monospace link-secondary link-underline-secondary link-underline-opacity-0 link-underline-opacity-100-hover small" href = "https://github.com/twbs/bootstrap/blob/v5.3.5/scss/_variables.scss" > scss/_variables.scss < / a > < div class = "d-flex ms-auto" > < button type = "button" class = "btn-clipboard mt-0 me-0" title = "Copy to clipboard" > < svg class = "bi" aria-hidden = "true" > < use xlink:href = "#clipboard" > < / use > < / svg > < / button > < / div > < / div > < div class = "highlight" > < pre class = "language-scss" > < code class = "language-scss" > < span class = "token property" > < span class = "token variable" > $lead-font-size< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $font-size-base< / span > < span class = "token operator" > *< / span > 1.25< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $lead-font-weight< / span > < / span > < span class = "token punctuation" > :< / span > 300< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $small-font-size< / span > < / span > < span class = "token punctuation" > :< / span > .875em< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $sub-sup-font-size< / span > < / span > < span class = "token punctuation" > :< / span > .75em< span class = "token punctuation" > ;< / span >
< span class = "token comment" > // fusv-disable< / span >
< span class = "token property" > < span class = "token variable" > $text-muted< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token function" > var< / span > < span class = "token punctuation" > (< / span > --< span class = "token variable" > #{$prefix}< / span > secondary-color< span class = "token punctuation" > )< / span > < span class = "token punctuation" > ;< / span > < span class = "token comment" > // Deprecated in 5.3.0< / span >
< span class = "token comment" > // fusv-enable< / span >
< span class = "token property" > < span class = "token variable" > $initialism-font-size< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $small-font-size< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $blockquote-margin-y< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $spacer< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $blockquote-font-size< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $font-size-base< / span > < span class = "token operator" > *< / span > 1.25< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $blockquote-footer-color< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $gray-600< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $blockquote-footer-font-size< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $small-font-size< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $hr-margin-y< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $spacer< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $hr-color< / span > < / span > < span class = "token punctuation" > :< / span > inherit< span class = "token punctuation" > ;< / span >
< span class = "token comment" > // fusv-disable< / span >
< span class = "token property" > < span class = "token variable" > $hr-bg-color< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span > < span class = "token comment" > // Deprecated in v5.2.0< / span >
< span class = "token property" > < span class = "token variable" > $hr-height< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span > < span class = "token comment" > // Deprecated in v5.2.0< / span >
< span class = "token comment" > // fusv-enable< / span >
< span class = "token property" > < span class = "token variable" > $hr-border-color< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span > < span class = "token comment" > // Allows for inherited colors< / span >
< span class = "token property" > < span class = "token variable" > $hr-border-width< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token function" > var< / span > < span class = "token punctuation" > (< / span > --< span class = "token variable" > #{$prefix}< / span > border-width< span class = "token punctuation" > )< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $hr-opacity< / span > < / span > < span class = "token punctuation" > :< / span > .25< span class = "token punctuation" > ;< / span >
< span class = "token comment" > // scss-docs-start vr-variables< / span >
< span class = "token property" > < span class = "token variable" > $vr-border-width< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token function" > var< / span > < span class = "token punctuation" > (< / span > --< span class = "token variable" > #{$prefix}< / span > border-width< span class = "token punctuation" > )< / span > < span class = "token punctuation" > ;< / span >
< span class = "token comment" > // scss-docs-end vr-variables< / span >
< span class = "token property" > < span class = "token variable" > $legend-margin-bottom< / span > < / span > < span class = "token punctuation" > :< / span > .5rem< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $legend-font-size< / span > < / span > < span class = "token punctuation" > :< / span > 1.5rem< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $legend-font-weight< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token null keyword" > null< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $dt-font-weight< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $font-weight-bold< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $list-inline-padding< / span > < / span > < span class = "token punctuation" > :< / span > .5rem< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $mark-padding< / span > < / span > < span class = "token punctuation" > :< / span > .1875em< span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $mark-color< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $body-color< / span > < span class = "token punctuation" > ;< / span >
< span class = "token property" > < span class = "token variable" > $mark-bg< / span > < / span > < span class = "token punctuation" > :< / span > < span class = "token variable" > $yellow-100< / span > < span class = "token punctuation" > ;< / span >
< / code > < / pre > < / div > < / div >
< h3 id = "sass-mixins" > Sass mixins< a class = "anchor-link" href = "#sass-mixins" > < / a > < / h3 >
< p > There are no dedicated mixins for typography, but Bootstrap does use < a href = "/docs/5.3/getting-started/rfs" > Responsive Font Sizing (RFS)< / a > .< / p > < / div > < / main > < / div > < footer class = "bd-footer py-4 py-md-5 mt-5 bg-body-tertiary" > < div class = "container py-4 py-md-5 px-4 px-md-3 text-body-secondary" > < div class = "row" > < div class = "col-lg-3 mb-3" > < a class = "d-inline-flex align-items-center mb-2 text-body-emphasis text-decoration-none" href = "/" aria-label = "Bootstrap" > < svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 118 94" role = "img" class = "d-block me-2" height = "32" width = "40" > < title > Bootstrap< / title > < path fill-rule = "evenodd" clip-rule = "evenodd" d = "M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z" fill = "currentColor" > < / path > < / svg > < span class = "fs-5" > Bootstrap< / span > < / a > < ul class = "list-unstyled small" > < li class = "mb-2" >
Designed and built with all the love in the world by the < a href = "/docs/5.3/about/team" > Bootstrap team< / a > with the help of < a href = "https://github.com/twbs/bootstrap/graphs/contributors" > our contributors< / a > .
< / li > < li class = "mb-2" >
Code licensed < a href = "https://github.com/twbs/bootstrap/blob/main/LICENSE" target = "_blank" rel = "license noopener" > MIT< / a > , docs < a href = "https://creativecommons.org/licenses/by/3.0/" target = "_blank" rel = "license noopener" > CC BY 3.0< / a > .
< / li > < li class = "mb-2" > Currently v5.3.5.< / li > < / ul > < / div > < div class = "col-6 col-lg-2 offset-lg-1 mb-3" > < h5 > Links< / h5 > < ul class = "list-unstyled" > < li class = "mb-2" > < a href = "/" > Home< / a > < / li > < li class = "mb-2" > < a href = "/docs/5.3/" > Docs< / a > < / li > < li class = "mb-2" > < a href = "/docs/5.3/examples" > Examples< / a > < / li > < li class = "mb-2" > < a href = "https://icons.getbootstrap.com/" > Icons< / a > < / li > < li class = "mb-2" > < a href = "https://themes.getbootstrap.com/" > Themes< / a > < / li > < li class = "mb-2" > < a href = "https://blog.getbootstrap.com/" > Blog< / a > < / li > < li class = "mb-2" > < a href = "https://cottonbureau.com/people/bootstrap" target = "_blank" rel = "noopener" > Swag Store< / a > < / li > < / ul > < / div > < div class = "col-6 col-lg-2 mb-3" > < h5 > Guides< / h5 > < ul class = "list-unstyled" > < li class = "mb-2" > < a href = "/docs/5.3/getting-started" > Getting started< / a > < / li > < li class = "mb-2" > < a href = "/docs/5.3/examples/starter-template" > Starter template< / a > < / li > < li class = "mb-2" > < a href = "/docs/5.3/getting-started/webpack" > Webpack< / a > < / li > < li class = "mb-2" > < a href = "/docs/5.3/getting-started/parcel" > Parcel< / a > < / li > < li class = "mb-2" > < a href = "/docs/5.3/getting-started/vite" > Vite< / a > < / li > < / ul > < / div > < div class = "col-6 col-lg-2 mb-3" > < h5 > Projects< / h5 > < ul class = "list-unstyled" > < li class = "mb-2" > < a href = "https://github.com/twbs/bootstrap" target = "_blank" rel = "noopener" > Bootstrap 5< / a > < / li > < li class = "mb-2" > < a href = "https://github.com/twbs/bootstrap/tree/v4-dev" target = "_blank" rel = "noopener" > Bootstrap 4< / a > < / li > < li class = "mb-2" > < a href = "https://github.com/twbs/icons" target = "_blank" rel = "noopener" > Icons< / a > < / li > < li class = "mb-2" > < a href = "https://github.com/twbs/rfs" target = "_blank" rel = "noopener" > RFS< / a > < / li > < li class = "mb-2" > < a href = "https://github.com/twbs/examples" target = "_blank" rel = "noopener" > Examples repo< / a > < / li > < / ul > < / div > < div class = "col-6 col-lg-2 mb-3" > < h5 > Community< / h5 > < ul class = "list-unstyled" > < li class = "mb-2" > < a href = "https://github.com/twbs/bootstrap/issues" target = "_blank" rel = "noopener" > Issues< / a > < / li > < li class = "mb-2" > < a href = "https://github.com/twbs/bootstrap/discussions" target = "_blank" rel = "noopener" > Discussions< / a > < / li > < li class = "mb-2" > < a href = "https://github.com/sponsors/twbs" target = "_blank" rel = "noopener" > Corporate sponsors< / a > < / li > < li class = "mb-2" > < a href = "https://opencollective.com/bootstrap" target = "_blank" rel = "noopener" > Open Collective< / a > < / li > < li class = "mb-2" > < a href = "https://stackoverflow.com/questions/tagged/bootstrap-5" target = "_blank" rel = "noopener" > Stack Overflow< / a > < / li > < / ul > < / div > < / div > < / div > < / footer > < script src = "/docs/5.3/dist/js/bootstrap.bundle.min.js" integrity = "sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq" > < / script > < script type = "module" src = "/docs/5.3/assets/Scripts.astro_astro_type_script_index_0_lang.BeKqXKw6.js" > < / script > < script type = "module" src = "/docs/5.3/assets/Scripts.astro_astro_type_script_index_1_lang.CAqD2hc_.js" > < / script > < script type = "module" > c o n s t p = ( ) = > { c o n s t t = d o c u m e n t . q u e r y S e l e c t o r ( " . b d - s i d e b a r " ) , a = d o c u m e n t . q u e r y S e l e c t o r ( " . b d - l i n k s - n a v . a c t i v e " ) ; i f ( ! t | | ! a ) r e t u r n ; c o n s t c = t . c l i e n t H e i g h t , i = a . o f f s e t T o p , r = a . c l i e n t H e i g h t , n = i , s = n - c + r ; ( t . s c r o l l T o p > n | | t . s c r o l l T o p < s ) & & ( t . s c r o l l T o p = n - c / 2 + r / 2 ) } , v = ( ) = > { d o c u m e n t . q u e r y S e l e c t o r A l l ( ' [ d a t a - b s - t o g g l e = " t o o l t i p " ] ' ) . f o r E a c h ( e = > { n e w b o o t s t r a p . T o o l t i p ( e ) } ) , d o c u m e n t . q u e r y S e l e c t o r A l l ( ' [ d a t a - b s - t o g g l e = " p o p o v e r " ] ' ) . f o r E a c h ( e = > { n e w b o o t s t r a p . P o p o v e r ( e ) } ) ; c o n s t t = d o c u m e n t . g e t E l e m e n t B y I d ( " t o a s t P l a c e m e n t " ) ; t & & d o c u m e n t . g e t E l e m e n t B y I d ( " s e l e c t T o a s t P l a c e m e n t " ) . a d d E v e n t L i s t e n e r ( " c h a n g e " , f u n c t i o n ( ) { t . d a t a s e t . o r i g i n a l C l a s s | | ( t . d a t a s e t . o r i g i n a l C l a s s = t . c l a s s N a m e ) , t . c l a s s N a m e = ` $ { t . d a t a s e t . o r i g i n a l C l a s s } $ { t h i s . v a l u e } ` } ) , d o c u m e n t . q u e r y S e l e c t o r A l l ( " . b d - e x a m p l e . t o a s t " ) . f o r E a c h ( e = > { n e w b o o t s t r a p . T o a s t ( e , { a u t o h i d e : ! 1 } ) . s h o w ( ) } ) ; c o n s t a = d o c u m e n t . g e t E l e m e n t B y I d ( " l i v e T o a s t B t n " ) , c = d o c u m e n t . g e t E l e m e n t B y I d ( " l i v e T o a s t " ) ; i f ( a ) { c o n s t e = b o o t s t r a p . T o a s t . g e t O r C r e a t e I n s t a n c e ( c ) ; a . a d d E v e n t L i s t e n e r ( " c l i c k " , ( ) = > { e . s h o w ( ) } ) } c o n s t i = d o c u m e n t . g e t E l e m e n t B y I d ( " l i v e A l e r t P l a c e h o l d e r " ) , r = ( e , o ) = > { c o n s t l = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ; l . i n n e r H T M L = [ ` < d i v c l a s s = " a l e r t a l e r t - $ { o } a l e r t - d i s m i s s i b l e " r o l