Laravel 9-获取http:// localhost:8000/css/app.css net :: err_aborted 404(找不到)

发布于 2025-02-08 17:55:53 字数 129 浏览 2 评论 0原文

我无法在应用程序中使用app.css 我用 < link href =“ {{Asset('css/app.css')}}}}” rel =“ stylesheet” type =“ text/css”>

I can't use the app.css in my application
I use
<link href="{{asset('css/app.css')}}" rel="stylesheet" type="text/css">

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

九公里浅绿 2025-02-15 17:55:53

默认情况下,Asset()助手从/public文件夹开始。如果您已经考虑了这一点,那么唯一的问题是您尚未运行npm Run Dev

public/
    |--- css/app.css
    |---js/

&lt; link href =“ {{Asset('css/app.css')}}}}“ rel =“ stylesheet” type =“ text/css”&gt; = public/css/css/css/css/css/css/css/css/css/ app.css

By default the asset() helper starts with the /public folder. If you have already taken this into consideration then the only problem will be that you have not run npm run dev.

public/
    |--- css/app.css
    |---js/

<link href="{{asset('css/app.css')}}" rel="stylesheet" type="text/css"> = public/css/app.css

沉默的熊 2025-02-15 17:55:53

在.env文件中检查您的资产URL。如果缺少它,将其添加到您的.env文件

Asset_url = public

中并运行PHP Artisan Config:Cache。

Check your asset url in .env file. If it is missing add it in your .env file

ASSET_URL=public

and run php artisan config:cache.

那一片橙海, 2025-02-15 17:55:53

如果

public/
    |--- css/app.css
    |---js/

并且

<link href="{{asset('css/app.css')}}" rel="stylesheet" type="text/css"> = public/css/app.css 

不工作,您可以使用

<link href="{{asset('css/app.css')}}" rel="stylesheet" type="text/css">  

或可以使用

<link href="{{asset('asset/css/app.css')}}" rel="stylesheet" type="text/css"> 

if

public/
    |--- css/app.css
    |---js/

and

<link href="{{asset('css/app.css')}}" rel="stylesheet" type="text/css"> = public/css/app.css 

not work you can use

<link href="{{asset('css/app.css')}}" rel="stylesheet" type="text/css">  

or you can use

<link href="{{asset('asset/css/app.css')}}" rel="stylesheet" type="text/css"> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文