php-mvc icon indicating copy to clipboard operation
php-mvc copied to clipboard

How to include css file

Open mahmudul-elahi7676 opened this issue 2 years ago • 3 comments

How to include css file in base.html

I created style.css file in public/assets/css/style.css

i want to link this file into base.html

If i include /assets/css/style.css this way

then in /home route it worked But if i use /product/create then it doesn’t work

mahmudul-elahi7676 avatar Oct 31 '23 08:10 mahmudul-elahi7676

You need to start the path with a slash so it's route relative:

<link rel="stylesheet" href="/assets/css/style.css">

daveh avatar Oct 31 '23 12:10 daveh

You need to start the path with a slash so it's route relative:

<link rel="stylesheet" href="/assets/css/style.css">

Not working brother

mahmudul-elahi7676 avatar Oct 31 '23 13:10 mahmudul-elahi7676

Are you running the code in a subfolder? Then you need to include that too

daveh avatar Oct 31 '23 17:10 daveh