leeo217
leeo217

Reputation: 13

VScode img folder location

Starting off with html and css and encountered one issue while placing img folder in project file images doesn't appear in the browser and moved the img folder inside the css folder within the project and now it is viewing in the browser.

what is the correct place for img folder for the project is it has to be in css folder or in main project folder?

Thank you in advance

Upvotes: 1

Views: 16279

Answers (2)

A Random Sunset
A Random Sunset

Reputation: 11

If you have the image folder in the same directory as your html file, then reference that folder and then the image as a path.

Example: src="./pictures/background.png"

Upvotes: 1

Jean
Jean

Reputation: 46

Probably, you're using absolute paths to reference your images, something like this :

  • "C:/Users/Jean/Desktop/Test/images/150x150.png"

Use relative paths to your 'index.html':

  • "./images/150x150.png"

About the place for the images folder, I think is good to have a basic structure like this :

enter image description here

Upvotes: 0

Related Questions