如何将 media-breakpoint-up 包含到 Bootstrap 4?
如果我被试过:
@include media-breakpoint-up(sm) {
html {
font-size: 16px;
}
}
然后我有错误:
错误:未定义的 mixin 'media-breakpoint-up'。在第 14 行......
我通过包含文件使用 Bootstrap 4:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js" integrity="sha384-THPy051/pYDQGanwU6poAc/hOdQxjnOEXzbT+OuUAFqNqFjL+4IGLBgCJC3ZOShY" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.2.0/js/tether.min.js" integrity="sha384-Plbmg8JY28KFelvJVai01l8WyZzrYWG825m+cZ0eDDS1f7d/js6ikvy1+X+guPIB" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/js/bootstrap.min.js" integrity="VjEeINv9OSwtWFLAtmc4JCtEJXXBub00gtSnszmspDLCtC0I4z4nqz7rEFbIZLLU" crossorigin="anonymous"></script>
最佳答案
您分享的是 SASS,一种扩展 CSS 功能的 CSS 预处理器语言。它不是“ Vanilla ” CSS。
@include media-breakpoint-up
需要从 SASS 编译成 CSS。这是 how to install SASS这样您就可以将 SASS 转换为 CSS。
我个人使用Grunt与 grunt-sass package监视我的 SASS 文件中的更改,以便在我开发时自动构建 CSS。
关于html - 如何将 media-breakpoint-up 包含到 Bootstrap 4?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40312122/