Tyler Obier
Tyler Obier

Reputation: 378

Where to put css file in laravel project

I have been searching for an answer to this question with no luck. This is my second day using laravel and I'm trying to create a custom 404 error page. I don't know where/how to include my .css file. Can someone please help me with this?

Upvotes: 17

Views: 76250

Answers (6)

mohamed shapaan
mohamed shapaan

Reputation: 36

put it in your public file and the html tags in view then to connect them with the css use

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

Upvotes: 2

Ibrahim El Aidi
Ibrahim El Aidi

Reputation: 136

1. put your CSS file in directory [PUBLIC/CSS]
2. in your FileName.blade.php in file just write :

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

Note Again : Don't Write asset('public/css/article.css') this wrong

Upvotes: 2

Abubakr Elghazawy
Abubakr Elghazawy

Reputation: 985

  1. Search for Public folder in Laravel.
  2. Create css folder (that contains stylesheet files of your project), javascript and Images folder (contains images that you will use in your project).

Go to layouts in app.blade.php file update html code using blade syntax:

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

and JS:

<script src="{{ asset('pickadate/lib/picker.js')}}"></script>

Upvotes: 7

Maganti Raghava
Maganti Raghava

Reputation: 11

<link rel="stylesheet" href="css/app.css">

simply add this your blade.php file

Upvotes: 1

JP Blanco
JP Blanco

Reputation: 1031

The best way is using blade syntax with the laravel helper for what you need

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

this folder css or whatever you named it, must be placed inside your public folder.

Upvotes: 12

Covik
Covik

Reputation: 862

Place your css files inside public folder and use link tag in html document (or 404 template)

Example

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

Upvotes: 28

Related Questions