Search code examples
imagevisual-studio-codedirectorylocation

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


Solution

  • 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