I am trying to add a background image for my website in Laravel 5.
I've used this in my css file.
html {
background-image: url("images/background.jpg");
}
the image is in the public folder of my Laravel project folder. I tried all the paths but it just doesn't load.
I keep getting this error:
http://Laravelproject.app:8000/background.jpg 404 (Not Found)
Any help would be appreciated. Thanks.
Works just fine with slash:
html {
background: url("/images/background.jpg");
}
Might be answering a little late but do this and hope it helps someone out there:
background-image:url({{url('images/php_mysql.jpg')}})
i am still unable to access image via css in Laravel 6
but
this code is work for me
(add image path in blade.php file)
<div id="loading" style="background-image: url('{{ asset('img/big-loader.gif')}}');">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With