abu abu
abu abu

Reputation: 7062

Add CSS in Laravel 8

I put my CSS file inside public/css folder. I added CSS file in head section like below.

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

But CSS is not working.

Upvotes: 6

Views: 15239

Answers (4)

Mak Alamin
Mak Alamin

Reputation: 154

This is working for me in Laravel 8 (make sure your files are in the public folder)

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

Upvotes: 5

NerdyGinger
NerdyGinger

Reputation: 406

In Laravel 8, make sure your files are in the public folder and reference them like this:

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

Upvotes: 4

Tousif Ahmed
Tousif Ahmed

Reputation: 1082

Below worked for me.

<link rel="stylesheet" type="text/css" href="{{ URL::to('css/app.css') }}">

Upvotes: 0

jpmc
jpmc

Reputation: 1193

I don't see why you can't just use a relative URL like:

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

Upvotes: 3

Related Questions