How to change Bootstrap's global default font size?

后端 未结 6 1916
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 01:46

Bootstrap\'s global default font-size is 14px, with a line-height of 1.428. How can I change its default global settings?

Will I have to change bootstrap.min.css in

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 02:40

    Bootstrap uses the variable:

    $font-size-base: 1rem; // Assumes the browser default, typically 16px
    

    I don't recommend mucking with this, but you can. Best practice is to override the browser default base font size with:

    html {
      font-size: 14px;
    }
    

    Bootstrap will then take that value and use it via rems to set values for all kinds of things.

提交回复
热议问题