How to make button text bold in bootstrap 5?

Hi Friends 👋,

Welcome To aGuideHub! ❤️

In this article, we will use some bootstrap 5 classes to make button text bold.

To make button text bold, put .fw-bold class to make button text bold in bootstrap 5.

Table of contents

  • Includes bootstrap 5 view
  • Includes bootstrap 5 library
  • Define its class name

Step 1: Includes bootstrap 5 view

To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your <head>.

<meta name="viewport" content="width=device-width, initial-scale=1">

Step 2: Includes bootstrap 5 library

First of all, load the bootstrap 5 framework CSS into the head tag of your webpage.

<!-- bootstrap 5 CSS -->
   <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
    integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
    crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
    integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT"
    crossorigin="anonymous"></script>

Step 3: Define its class name

After that, create bold text button with a class name .fw-bold.

  <div class="text-center">
    <h3> Make button bold text </h3>
    <a href="#" class="btn btn-info fw-bold mr-2">Bold</a>
  </div>
</body>

Example.

Let’s look at the following example to understand how it basically works:

<!DOCTYPE html>
<html lang="en">

<head>
  <title>Bootstrap </title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
    integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
    crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
    integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT"
    crossorigin="anonymous"></script>
</head>

<body>
  <div class="text-center">
    <h3> Make button bold text </h3>
    <a href="#" class="btn btn-info fw-bold mr-2">Bold</a>
  </div>
</body>
</body>

</html>

Check the output of the above code example.

Bootstrap, Bold, Button

All the best 👍