Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Laravel8没有加载css和js/bootstrap_Html_Css_Laravel_Laravel 5_Laravel 8 - Fatal编程技术网

Html Laravel8没有加载css和js/bootstrap

Html Laravel8没有加载css和js/bootstrap,html,css,laravel,laravel-5,laravel-8,Html,Css,Laravel,Laravel 5,Laravel 8,我不知道为什么,这不是我在laravel的第一个项目,但我的css不起作用,我在代码中找不到任何问题,可能是我累了什么的,但这让我困了大约10个小时 我的CSS似乎不起作用,为什么?我不知道,我所有的文件夹都在公用文件夹中,我的网站看起来一点都不像模板 我在终端中也没有看到任何错误,当我使用CTRL+U时,所有CSS链接都打开了。我的建议 <link href="{{ asset ('animate.css/animate.css') }}" rel="s

我不知道为什么,这不是我在laravel的第一个项目,但我的css不起作用,我在代码中找不到任何问题,可能是我累了什么的,但这让我困了大约10个小时

我的CSS似乎不起作用,为什么?我不知道,我所有的文件夹都在公用文件夹中,我的网站看起来一点都不像模板


我在终端中也没有看到任何错误,当我使用CTRL+U时,所有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="https://fonts.googleapis.com/css?family=Raleway:400,500,600,700" rel="stylesheet" />
<link href="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">
如果任何js或css不起作用,只需检查url,如

http://localhost:8000/animate.css/animate.css


并使用
php artisan serv
运行laravel应用程序

在laravel中链接scrripts和css的正确语法为:

link rel=“stylesheet”href=“{asset('new_assets/assets/css/style.css')}”

我在我的laravel项目中使用了这个,我的css文件位于“new_assets/assets/css/style.css”中。 两个开头中的第一个“asset”字用括号指向laravel/公用文件夹。请确保在使用{asset('some path')}时,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" type="text/css">
<link href="{{asset('https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,800,900')}}" rel="stylesheet" type="text/css">
<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
只显示源代码,对吗?请尝试
F12
(您浏览器的DevTools),以防万一,我会删除
asset
和文件位置之间的空间。当我按F12 get'net::ERR_ABORTED 404(未找到)时,似乎会出现此错误,但文件位于特定文件夹“animate.css”中@brombeer@Bennett我做到了,没有变化就像你的服务器设置不正确一样。您使用的是哪台服务器?试着使用
php artisan serve
运行您的站点,看看是否有效
/public/
不应出现在URL中,它应该是服务器的“DocumentRoot”这根本不起作用,看起来所有css文件夹都是公共的,这就是我使用此{{{asset('some path')}的原因。我像你说的那样改变了语法,但没有改变
<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" type="text/css">
<link href="{{asset('https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,800,900')}}" rel="stylesheet" type="text/css">
<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">