Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CSS Background Image using url() Not Displaying

I recently have being following this tutorial on youtube https://www.youtube.com/watch?v=FazgJVnrVuI and I am up to a part where I am adding images (around 1 hour in). I have tried everything I could and still it doesnt show. I would love some help. Thanks 🙂

Here is my code :

css

...

 background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0% rgba(17, 17, 17, 0.6) 100%), url('/images/pic2.jpg');

...

My file directory looks like this

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Main folder

Images/

  pic1.svg

  pic2.jpg

  pic3.jpg

html and css all in the main folder.

This error also pops up

invalid property value

>Solution :

I think the issue is both with the URL and linear-gradient or either of them. If your code is in main folder and images are in the images folder then URL should be
url('images/pic2.png'). Also, try to change the linear gradient to test if it works.

background-image: linear-gradient(to right,  rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%), url('images/pic2.png');
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading