【发布时间】:2021-08-16 23:30:45
【问题描述】:
我不知道为什么,这不是我在 laravel 中的第一个项目,但我的 css 无法正常工作,我在代码中找不到任何问题,也许我很累或其他什么,但这让我陷入困境大约 10 小时。
似乎我的 CSS 无法正常工作,为什么?我不知道,我的所有文件夹都在公用文件夹中,而我的网站看起来一点也不像模板。
<link href="{{ asset ('animate.css/animate.css') }}'" rel="stylesheet" type="text/css" />
<link href="{{ asset ('fontawesome/css/all.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset ('https://fonts.googleapis.com/css?family=Raleway:400,500,600,700') }}" rel="stylesheet" />
<link href="{{ asset ('https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,800,900') }}" rel="stylesheet" />
<link href="{{ asset ('chosen/chosen.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset ('jquery-ui-custom/jquery-ui.min.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset ('pentix/css/pentix.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset ('css/pex-theme.css') }}" rel="stylesheet" type="text/css">
当我使用 CTRL + U 时,我在终端中也没有看到任何错误,所有 CSS 链接都打开了。
【问题讨论】:
-
ctrl-u只显示源代码,对吧?试试F12(你浏览器的开发者工具) -
以防万一,我会删除
asset和文件位置之间的空格。 -
当我按 f12 GET localhost/APCService/public/animate.css/animate.css' net::ERR_ABORTED 404 (Not Found) 时似乎出现此错误,但文件位于特定文件夹“animate.css”@brombeer 中跨度>
-
@Bennett 我做到了,没有改变
-
看起来您的服务器设置不正确。您使用的是哪个服务器?尝试使用
php artisan serve运行您的网站,看看是否可行。/public/不应出现在 URL 中,它应该是您服务器的“DocumentRoot”
标签: html css laravel laravel-5 laravel-8