How to include CSS in laravel 5 running with artisan?

后端 未结 3 1225
太阳男子
太阳男子 2021-01-13 00:40

I am new to Laravel and am trying to get the css in the public directory to load. The page loads no problem but the CSS gives me a 404 error in firebug:

\"Ne         


        
3条回答
  •  孤街浪徒
    2021-01-13 01:21

    When you specify a path for your css and JS files, the root of the files need to be in 'project-name\public\' and not 'project-name\'

    If you want for example to include with blade 'mytheme.css' which is inside 'mypersonalcss' folder ('mypersonnalcss\mytheme.css') fist add it to the project in 'project-name\public\mypersonnalcss\mytheme.css'

    Then add it in your blade file :

    
    

    Please see : Laravel 5 not finding css files to learn more about how to add assets to blade files.

提交回复
热议问题