The background-url() function was used to apply the background screen to PurpleCloud.png. However, no matter what I do, the image is not applied. Where did we go wrong?
After learning about how to write a file path, I tried several methods, but there was no change. How should I write it?
In your case, if you use background image on a div, make sure you also add width and height to that div, try inspecting using Chrome devTool it will show you the element and its css.
2
Answers
The correct syntax should be something like:
In your case, if you use background image on a div, make sure you also add width and height to that div, try inspecting using Chrome devTool it will show you the element and its css.
Try background-image: url(‘/src/assets/PurpleCloud.png’);