Bootstrap 4的响应文本

时间:2019-05-20 16:56:12

标签: css sass bootstrap-4 responsive

使用bootstrap 4我想为不同的断点使用不同的字体样式。我知道我可以使用媒体查询来做到这一点,但是在Bootstraps网站上,它给出了这样的示例:

html {
  font-size: 1rem;
}

@include media-breakpoint-up(sm) {
  html {
    font-size: 1.2rem;
  }
}

@include media-breakpoint-up(md) {
  html {
    font-size: 1.4rem;
  }
}

@include media-breakpoint-up(lg) {
  html {
    font-size: 1.6rem;
  }
}

可以在这里找到: https://getbootstrap.com/docs/4.0/content/typography/

我的问题是,这是常规CSS还是SASS?试图研究它,我发现有很多人说他们将其输入到普通的CSS文件中,导致页面溢出。但是,当我这样做时,它永远不会起作用。所以我认为这不是正常的CSS?或者如果是的话,我在做什么错?我必须先声明一些内容才能理解吗?我尝试使用在线SASS编译器,但缺少mixin声明。在正确方向上的任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

在Bootstrap Css中,仅当您使用自定义类或ID名称然后在其上实现CSS时才起作用。只需使用与引导程序中存在或给出的Css默认类不同的类或ID名称即可。您必须使用SASS编译器。

检查此:https://getbootstrap.com/docs/4.0/getting-started/theming/

https://bootstrapcreative.com/can-adjust-text-size-bootstrap-responsive-design/