在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
laravel 应用程序的服务器 document_root 是:
/var/www/laravel/public
这是目录映射:
这是服务器配置文件: 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/