0

My laravel project does not find any of the css files of any of the pages. It shows up with the error,

GET http://localhost:8000/dashboard.css net::ERR_ABORTED

Did not find too many of the similar questions but tried the some solutions that I have found but obviously those did not help, otherwise I would not be asking again.

I`m using a Ubuntu PC.

Here are everything that I have tried.

  1. Checked file permissions, all the files have all read, write and execution privileges.
  2. Tried restarting the localhost many times.
  3. Tried using the asset() function, <link rel="stylesheet" type="text/css" href="{{asset('dashboard.css')}}">
  4. Tried using absolute path though I have the css files in the same directory as the blade.php files.

None of the above mentioned ways fixed it. Some clue would help me a lot. Thank you.

1 Answer 1

7

The CSS files need to be in the public folder, or a subfolder of public, not the view folder where the blade php files are. public is where you want to put any javascript files, css files, images, or whatever, and the root of the public folder becomes the root of your website when it's running.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for you response. I have put it in the /public/css folder. I changed it to <link rel="stylesheet" type="text/css" href="/home/toorja/Desktop/Blog/public/css/dashboard.css"> .. Still did not work.
Public is the web root, not part of your path. Try just href=“css/dashboard.css” (use the proper kind of quotation marks of course)
just use <link rel="stylesheet" type="text/css" href="{{asset('css/dashboard.css')}}">
@RatnadeepChakraborty u may accept the answer if it works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.