CSS 文件未在 Laravel View 中加载

标签 css laravel nginx

在custom.blade.php文件中,链接css:

<link rel="stylesheet" href="{{URL::asset('assets/bootstrap-4.1.3/bootstrap.min.css')}}">

它生成这个位置:

http://localhost.laravel/assets/bootstrap-4.1.3/bootstrap.min.css 

但是在这个 URL 中没有获取 CSS 文件,我得到错误: enter image description here

laravel 应用程序的服务器 document_root 是:

/var/www/laravel/public 

这是目录映射:

enter image description here

这是服务器配置文件: enter link description here

最佳答案

CSS 文件未加载与文件路径错误有关。您忘记了 bootstrap-* 文件夹中的 css 文件夹

{{ asset('assets/bootstrap-4.1.3/css/bootstrap.min.css') }}

屏幕截图中显示的错误与未找到 View 或未定义 url/路由有关。

关于CSS 文件未在 Laravel View 中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52113245/

相关文章:

php - 对表的sql条件查询

laravel - Nuxt-Laravel-Sanctum CSRF token 不匹配419错误

NGINX 入口 Controller 、SSL 和 optional_no_ca

php - 浏览器问题

html - 背景图片不会在 IE 8 上显示

php - laravel中无法从ajax获取数据

ruby-on-rails-3 - 如何重新编译 nginx

apache - 在 Apache Web Server 前配置 NGINX Reverse Proxy

jquery - ReactJS - 在表格行上使用 slideDown(切换)?

html - 背景大小:封面仅适合宽度