How to increase 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've included a link to a codeply project, so you can see it in action. The environment already has Bootstrap 4 loaded in it. If you change the value of the font-size
for the html
selector and run the project you can see how the sizing of the elements all change relative to the root element.
Adding three lines of CSS to your stylesheet should be pretty easy:
html {
font-size: 16px;
}
You can use .h1
to .h6
bootstrap classes or you can make your own custom CSS class and define font size over here and put your class on your HTML element.