gpt4 book ai didi

php - laravel 5.1 css 和 js 文件无法读取

转载 作者:太空宇宙 更新时间:2023-11-04 11:15:44 25 4
gpt4 key购买 nike

我已将我的 Assets 文件夹复制到公共(public)文件夹并使用调用我的 css 文件

<link href="{{!! asset('assets/global/plugins/font-awesome/css/font-awesome.min.css') !!}}" rel="stylesheet" type="text/css" />


<link href="{{ asset('assets/global/plugins/font-awesome/css/font-awesome.min.css') }}" rel="stylesheet" type="text/css" />

但是当我打开我的本地主机查看我的应用程序时,css 不起作用,当我使用 inspect element 检查 css 时,它显示此错误

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Object not found!</title>
<link rev="made" href="mailto:postmaster@localhost" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
body { color: #000000; background-color: #FFFFFF; }
a:link { color: #0000CC; }
p, address {margin-left: 3em;}
span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Object not found!</h1>
<p>


The requested URL was not found on this server.



The link on the
<a href="http://localhost:7777/laravel/resources/views/login.blade.php">referring
page</a> seems to be wrong or outdated. Please inform the author of
<a href="http://localhost:7777/laravel/resources/views/login.blade.php">that page</a>
about the error.



</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:postmaster@localhost">webmaster</a>.

</p>

<h2>Error 404</h2>
<address>
<a href="/">localhost</a><br />
<span>Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.12</span>
</address>
</body>
</html>

最佳答案

首先,你将所有的 css 和 js 文件放在 public 文件夹中。即,wamp->www->你的元素文件夹->public。

然后在编码部分简单地使用下面提到的技术。

<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>

<link rel="stylesheet" type="text/css" href="../css/jquery.datetimepicker.css"/>

<script type="text/javascript" src="../select/select2.min.js"></script>
<script type="text/javascript" src="../select/select2.js"></script>

<link href="../select/select2.css" rel="stylesheet">

关于php - laravel 5.1 css 和 js 文件无法读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33246736/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com