実現したいこと
Laravelにcssを適応させたいのですが、適応させることが出来ませんでした。
{{}}で囲んでパスを指定するだけでは適応させることは不可能でしょうか?
ちなみにbodyの背景を黒にしようとしているのですが、黒になっていないので適応されていないと思われます。
前提
発生している問題・エラーメッセージ
resource/layouts/app.blade.phpにpublic/cssのcssファイルのパスを指定したのですが、適応させられませんでした。
cssが適応されませんでした。
!追記
テスト環境のコンソール
user.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) post.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) post.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) user.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
!追記
上記のエラーは下記のコードに書き換えたところ、消えましたが背景色は黒になりませんでした。
まだ適応されていないようです。
該当のソースコード
resources/layouts/app.blade.php
1<!--css--> 2 <link href="{{ asset('css/app.css') }}" rel="stylesheet"> 3 <link href="{{ asset('css/post.css') }}" rel="stylesheet"> 4 <link href="{{ asset('css/user.css') }}" rel="stylesheet">
ファイル構成
test
|
|public-css-app.css
試したこと
relや{{}}で囲んだり、Laravel内にキャッシュが残っているなどの理由も考えられると書かれており、それも試してみたのですが、適応されませんでした。
補足情報(FW/ツールのバージョンなど)
php8
Laravel10

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。