我没有使用本地主机访问文件,而是使用域名 lsapp.com 当我尝试使用 Assets 链接到 css 文件时,它链接到 lsapp.com/css/app.css 但不起作用。使用 lsapp.com 时,公用文件夹中的相同 index.php 文件打开。 我尝试了很多不同的方法,但都没有用。请帮忙。
目前正在使用但不起作用
<link href="{{ asset('css/app.css') }}" rel="stylesheet" type="text/css" />
但是如果我使用本地主机打开文件,css 工作正常。
http://localhost/lsapp/public/index.php
最佳答案
我认为在最新版本中使用 Laravel 会更传统。
mix.styles([
'asset/css/app.css',
]);
请引用:
https://laracasts.com/discuss/channels/laravel/best-way-to-use-custom-css-in-laravel
关于php - 在 laravel 中使用 Assets 链接到 css 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52981691/