Background-image URL in CSS

Hi guys - I am trying to add this image to my css as a background image but it is not displaying it.

my image: https://unsplash.com/photos/0bgCyhlq9oU
an image from codeacademy that works: ttps://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-4/img-mission-background.jpg

Does the link have to be local?

Thanks!

I think your problem is that the URL you provided is not the URL to the image, but to the unsplash site. If you right click on the image and copy the link to it, this is what you would get:

https://images.unsplash.com/photo-1587045525473-4861b1f9b5b2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3888&q=80

Try using that URL instead!

Thank you so so much! :star_struck:

1 Like