0

Not Loading CSS File In Laravel From public folder

i have all the css file in public folder and i also link them to my index but the css not working.

1
  • Have you added like this: <link rel="stylesheet" href="asset('css/style.css')"> Commented Feb 6, 2021 at 13:33

2 Answers 2

3

Try using PHP built-in webserver instead of artisan server php -S localhost:8000 -t public/ (run this command in the root of your Laravel project).

Also, you need to run npm install && npm run dev so that the default CSS and JS will be compiled. (Laravel documentation)

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

Comments

0

You can access the public folder using asset (). Let's assume that there is a template folder under Public and a style.css file in this folder. If you use it as follows, your problem will be solved.

<link rel="stylesheet" href="{{ asset('template/') }}/style.css">

Comments

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.