Hackforge Academy

Category: javascript

bootstrap typography colors and utilities

Published on 30 Sep 2026

Explanation

Bootstrap provides predefined typography classes for headings, lead text, alignment, and text formatting.

Code:

<h1 class="display-4">Welcome</h1>
<p class="lead">Learn Bootstrap</p>
<p class="text-center">Centered Text</p>

Explanation

Bootstrap provides contextual text color classes such as primary, success, danger, warning, and muted.

Code:

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

Explanation

Background utility classes can quickly apply predefined background colors.

Code:

<div class="bg-primary text-white">
  Primary Background
</div>

<div class="bg-light">
  Light Background
</div>

Explanation

Spacing utilities such as margin and padding can be applied without writing custom CSS.

Code:

<div class="mt-3 mb-4 p-3">
  Spaced Content
</div>

Explanation

Display and visibility utilities help control how elements appear at different screen sizes.

Code:

<div class="d-none d-md-block">
  Visible on medium screens and above
</div>

πŸš€ Learn Spring Boot with real-world projects

πŸ’‘ Build REST APIs step by step

🧠 Improve backend development skills

🎯 Get career-ready practical training

Join Our Free WhatsApp Community

Direct access to niche-specific mentors and peers on WhatsApp.

🐍

Python Community

Discuss Django, FastAPI, AI integration, and automation scripts with 15k+ developers.

Join Python Community
βš›οΈ

React Community

Master Next.js, Framer Motion, and State Management. Share your latest UI components.

Join React Community
β˜•

Java Community

Deep dives into Spring Boot, Microservices architecture, and high-performance backend ops.

Join Java Community