Mastering Bootstrap: XS Font Size Secrets

Ruth Jul 09, 2026

In the realm of responsive web design, Bootstrap has emerged as a powerful tool, offering a wide range of customization options, including font sizes. When it comes to the smallest screen sizes, like mobile devices, understanding and manipulating the xs font size in Bootstrap can significantly enhance user experience. Let's delve into the intricacies of Bootstrap's xs font size.

Bootstrap 4 cheat sheet
Bootstrap 4 cheat sheet

Bootstrap employs a mobile-first approach, which means styles for smaller screens are first defined, and then overridden for larger screens. The xs breakpoint in Bootstrap corresponds to screens smaller than 576px wide. Understanding this breakpoint is crucial when tweaking the xs font size.

the different types of font and numbers
the different types of font and numbers

Default xs Font Size in Bootstrap

By default, Bootstrap sets the font size for xs screens to 0.875rem, which is equivalent to 14px. This size is intended to provide a comfortable reading experience on small screens.

40+ Best Free Bootstrap Templates & Themes in 2026 — Speckyboy
40+ Best Free Bootstrap Templates & Themes in 2026 — Speckyboy

The default xs font size is applied globally to all text elements within the Bootstrap framework. However, you can easily override this default to suit your design needs.

Changing the xs Font Size Globally

Bootstrap 4 Cheat Sheet - The ultimate list of Bootstrap classes
Bootstrap 4 Cheat Sheet - The ultimate list of Bootstrap classes

To change the xs font size globally, you can use the $font-size-base variable in your custom CSS. This variable is responsible for setting the base font size for all text elements at the xs breakpoint.

For instance, to set the xs font size to 16px, you would write:

@media (max-width: 575.98px) {
  $font-size-base: 16px !important;
}

Changing the xs Font Size for Specific Elements

A Beginner's Guide to the Latest Bootstrap 5 Utilities
A Beginner's Guide to the Latest Bootstrap 5 Utilities

If you want to change the xs font size for specific elements only, you can target those elements directly. For example, to increase the font size of headers (h1 through h6) at the xs breakpoint, you could use:

@media (max-width: 575.98px) {
  h1, h2, h3, h4, h5, h6 {
    font-size: 1.5em !important;
  }
}

Responsive Font Sizes in Bootstrap

Bootstrap also provides pre-defined responsive font sizes that you can use to create consistent typography across different screen sizes. These sizes are based on the root font size and are defined as rem units.

Bootstrap 5 Classes List Cheat Sheet
Bootstrap 5 Classes List Cheat Sheet

For instance, to use the h1 font size at the xs breakpoint, you can use the .h1 class:

This is a large heading

Bootstrap Glyphicons
Bootstrap Glyphicons
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap 5 Classes List Cheat Sheet
Bootstrap 5 Classes List Cheat Sheet
bootstrap 3 - cheap sheet
bootstrap 3 - cheap sheet
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
a white and purple poster with the words,'photography checklist'on it
a white and purple poster with the words,'photography checklist'on it
the bootstrap 3 - cheap sheet is shown in this screenshote image
the bootstrap 3 - cheap sheet is shown in this screenshote image
Bootstrap Tutorial – Introduction
Bootstrap Tutorial – Introduction
Bootstrap 4: What’s New
Bootstrap 4: What’s New
Blockquote Code | Bootstrap 5.3 snippet for highlighting content in a visually separate and eye-catching manner
Blockquote Code | Bootstrap 5.3 snippet for highlighting content in a visually separate and eye-catching manner
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Understanding Bootstrap 5 Layout
Understanding Bootstrap 5 Layout
Meaning of numbers in
Meaning of numbers in
Bootstrap Navbar Guide and Free Navigation Examples
Bootstrap Navbar Guide and Free Navigation Examples
Complete list of Font Awesome icons with their CSS content values
Complete list of Font Awesome icons with their CSS content values
Bootstrap 4 Cheat Sheet - The ultimate list of Bootstrap classes
Bootstrap 4 Cheat Sheet - The ultimate list of Bootstrap classes
Bootstrap 4 Admin Dashboard Template
Bootstrap 4 Admin Dashboard Template
How To Customize Twitter’s Bootstrap — Smashing Magazine
How To Customize Twitter’s Bootstrap — Smashing Magazine
a black and white poster with the words css font stack
a black and white poster with the words css font stack
How to Migrate from Bootstrap Version 3 to 4
How to Migrate from Bootstrap Version 3 to 4

Customizing Responsive Font Sizes

If the default responsive font sizes don't meet your needs, you can customize them by modifying the relevant variables in your custom CSS. For example, to increase the font size of the .h1 class at the xs breakpoint, you could use:

@media (max-width: 575.98px) {
  .h1 {
    font-size: 2em !important;
  }
}

In conclusion, mastering the xs font size in Bootstrap can help you create responsive, user-friendly websites that adapt seamlessly to small screens. By understanding and leveraging the power of Bootstrap's responsive font sizes, you can enhance the readability and aesthetics of your web designs. So, go ahead, experiment, and create stunning web experiences!