【发布时间】:2019-05-24 18:17:05
【问题描述】:
我正在尝试使用将引导 css 链接到我的 Laravel 项目 或者在我看来,但它不起作用。
在 scss 类中我尝试了这个:
@import 'node_modules/bootstrap/scss/bootstrap' or @import '~bootstrap/scss/bootstrap';
在视图类中我尝试了这个:
<!--<link rel="stylesheet" type="text/css" href="css/app.css"/>-->
or <link rel="stylesheet" type="text/css" href="{{url('css/app.css')}}"/>
我的 scss 类如下所示:
@import url('https://fonts.googleapis.com/css?family=Nunito');
@import 'variables';
@import '~bootstrap/scss/bootstrap';
//@import 'node_modules/bootstrap/scss/bootstrap';
@import 'custom';
它们显示任何错误,但它不加载引导样式
【问题讨论】:
-
检查浏览器开发者控制台的网络选项卡,查看它试图从哪个 URL 加载,以及它是否是项目中
public目录的正确路径。 -
Sass首先需要编译成css才能在浏览器中工作