0

Why doesn't my background image load?

background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Fairy_of_Eagle_Nebula.jpg/506px-Fairy_of_Eagle_Nebula.jpg"); Is it alright? I'm opening it on Chrome

18th Aug 2019, 11:28 AM
Aaditya Thakur
Aaditya Thakur - avatar
4 Antworten
+ 2
Please show your code here so that we can help you https://www.sololearn.com/post/75089/?ref=app
18th Aug 2019, 1:57 PM
Gordon
Gordon - avatar
+ 1
You need to put it in a selector ex.: body { background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Fairy_of_Eagle_Nebula.jpg/506px-Fairy_of_Eagle_Nebula.jpg"); } That should work fine, for me it does.
18th Aug 2019, 12:33 PM
Paul Grasser
Paul Grasser - avatar
0
The problem is different. When I run the code on sololearn it works fine but when I use the same code externally, the background doesn't load. Rest of the CSS file runs fine.
18th Aug 2019, 2:23 PM
Aaditya Thakur
Aaditya Thakur - avatar
0
Paul Grasser 💻 I already have it in body selector. I just didn't paste it here
18th Aug 2019, 2:25 PM
Aaditya Thakur
Aaditya Thakur - avatar