Bootstrap

Bootstrap Typography

Typography plays a vital role in user experience and visual hierarchy. Bootstrap provides a rich set of predefined typography styles to ensure your text is readable, responsive, and visually consistent across all devices.

Whether it’s headings, paragraphs, blockquotes, or inline elements, Bootstrap helps you style your content without writing custom CSS.


Headings

Bootstrap supports all six HTML heading tags (<h1> through <h6>) and styles them with consistent spacing and font weights.

html
<h1>h1. Bootstrap heading</h1>
<h2>h2. Bootstrap heading</h2>
<h3>h3. Bootstrap heading</h3>
<h4>h4. Bootstrap heading</h4>
<h5>h5. Bootstrap heading</h5>
<h6>h6. Bootstrap heading</h6>

You can also use .h1 to .h6 classes on other elements (like <div> or <span>) to apply heading styles without changing the tag.

html
<p class="h3">This is styled like an h3</p>

Display Headings

For a larger, more prominent title, use display classes:

html
<h1 class="display-1">Display 1</h1>
<h1 class="display-2">Display 2</h1>
<h1 class="display-3">Display 3</h1>
<h1 class="display-4">Display 4</h1>
<h1 class="display-5">Display 5</h1>
<h1 class="display-6">Display 6</h1>

These are useful for hero sections, banners, or marketing pages.


Paragraphs & Lead Text

Bootstrap styles paragraphs with margin-bottom by default for spacing.

html
<p>This is a standard paragraph.</p>
<p class="lead">This paragraph stands out with a larger font size and lighter weight.</p>

Use .lead for introductory or attention-catching text.


Text Alignment & Transform

Bootstrap includes utility classes to align and transform text:

Text Alignment:

html
<p class="text-start">Left aligned</p>
<p class="text-center">Center aligned</p>
<p class="text-end">Right aligned</p>

Text Transform:

html
<p class="text-lowercase">LOWERCASE TEXT</p>
<p class="text-uppercase">uppercase text</p>
<p class="text-capitalize">capitalize each word</p>

Text Colors & Backgrounds

You can apply Bootstrap’s contextual color classes:

html
<p class="text-primary">Primary text</p>
<p class="text-success">Success text</p>
<p class="text-danger">Danger text</p>

And for contrast, background utility classes:

html
<p class="bg-warning text-dark">Warning background</p>

Blockquotes

For quotations or testimonials, use the .blockquote class:

html
<blockquote class="blockquote">
<p>A well-known quote, contained in a blockquote element.</p>
<footer class="blockquote-footer">Someone famous</footer>
</blockquote>

Inline Text Elements

Bootstrap supports standard inline tags and classes:

  • <mark>: Highlighted text

  • <del>: Deleted text

  • <ins>: Inserted text

  • <small>: Smaller text

  • <strong>: Bold text

  • <em>: Italicized text

Example:

html
<p>This is <mark>highlighted</mark> text.</p>

✅ Conclusion

Typography in Bootstrap is clean, flexible, and easy to customize. It provides everything from scalable headings and responsive text to colored, aligned, and styled content. Mastering these basics helps set the tone and readability of your website.

Leave a Reply

Your email address will not be published. Required fields are marked *