Why this class "font-weight-bold" doesn't work? [Bootstrap]

Viewed 7201
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="/css/bootstrap.css">
  </head>
  <body>

    <h1 class="h1">Bootstrap</h1>
    <p class="font-weight-bold">Palabra</p>
    <p class="font-italic">Palabra</p>

  </body>
</html>

Adding "font-weight-bold" class to a p doesn't make any change to the text

No change

What can i do?

5 Answers

It's font-weight-bold for bootstrap 4

And class="fw-bold" for Bootstrap 5

Using class= "fw-bold" worked for me. I am working with bootstrap 5.

You have to use font-weight-bold But you used text-weight-bold that's why your bootstrap class style is not working

Before version bootstrap 5 used class='font-weight-bold', But bootstrap 5 use class='fw-bold'

Bootstrap version 5 <p class="fw-bold">YOUR_TEXT</p>

Bootstrap version 4 <p class="font-weight-bold">YOUR_TEXT</p>

Bootstrap version < 4 <strong>YOUR_TEXT</strong>

For the other styles such as normal and italic:

Bootstrap 4
<p class="font-weight-normal">YOUR_TEXT</p> // Normal
<p class="font-weight-light">YOUR_TEXT</p>  // Light
<p class="font-italic">YOUR_TEXT</p>        // Italic
Bootstrap 5
<p class="fw-bolder">Bolder weight text (relative to the parent element).</p>
<p class="fw-normal">Normal weight text.</p>
<p class="fw-light">Light weight text.</p>
<p class="fw-lighter">Lighter weight text (relative to the parent element).</p>
<p class="fst-italic">Italic text.</p>
<p class="fst-normal">Text with normal font style</p> 
Related