I tried to link a css to html in laravel and link an image (both css and image are in public folder) but it does not work. I tried using asset and url but it does not work either. I don’t understand what is wrong. This is how I wrote the link:
<link rel="stylesheet" href="/css/styles.css">
<img src="/img/logo-kitsune-dojo.jpg" alt="logo kitsune dojo">
I have already tried asset and url. They don’t work. I want mi css and my imagen to link.
2
Answers
use
asset()
function generates a URLYou may solve this problem by using asset() helper function
For css link: If your css exist in public folder folowing this directory you may use this
For Image: If your image exist in public folder folowing this directory you may use this