Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set font-weight using Bootstrap classes

People also ask

How do I change font-size in Bootstrap 4?

Because Bootstrap 4 uses rem for the font-size unit of most of it's elements, you can set the font-size in px on the HTML element in your own stylesheet and this will change the default sizing Bootstrap applies to your elements.


I found this on the Bootstrap website, but it really isn't a Bootstrap class, it's just HTML.

<strong>rendered as bold text</strong>

In Bootstrap 4, class="font-weight-bold" is what you are looking for.

For other styles, there is text-weight-normal and text-italic classes.


In Bootstrap 4:

class="font-weight-bold"

Or:

<strong>text</strong>

Create in your Site.css (or in another place) a new class named for example .font-bold and set it to your element

.font-bold {
  font-weight: bold;
}

On Bootstrap 4 you can use:

<p class="font-weight-bold">Bold text.</p>
<p class="font-weight-normal">Normal weight text.</p>
<p class="font-weight-light">Light weight text.</p>

The most accurate way of how to do it if using Boostrap 5 is as in example below:

<p class="fw-bold">Bold text.</p>

You should use bootstarp's variables to control your font-weight if you want a more customized value and/or you're following a scheme that needs to be repeated ; Variables are used throughout the entire project as a way to centralize and share commonly used values like colors, spacing, or font stacks;

you can find all the documentation at http://getbootstrap.com/css.