0
Is there anything wrong in this css styling
I wrote the following code to set an image as my background-image for div with class name main Code : .main{ padding-top:110px; padding-bottom:60px; background-image:url("../images/main.jpg"); background-color:yellow; background-size:cover; } Can anyone find anything wrong in this code because the image is not loading when I'm running the webpage but all other styling has been applied.
5 Answers
+ 2
Maybe the image url is incorrect.
+ 2
You can refer to this link,
https://www.codecademy.com/articles/host-images-on-dropbox
0
Pranav Kalro it's correct I checked it
0
I copied that image to my css folder and it worked.
Before that the following was my file path like
Website
css
index.css
images
main.jpg
index.html
Isn't "../images/main.jpg" the correct way to link the main.jpg to index.css ?
0
I think you should export your main.jpg to the folder your index.css and html file is
That way u can retrace URL problems easier