Jayland De Leon Jayland De Leon - 5 months ago 15
HTML Question

HTML - Images not showing and Format is not the same as my Index.html

I'm having troubles loading the images and format of my another page, it is not showing. I create a folder(named pages) and put my page1.html file. When I click the button to redirect to my page1.html, the images are not showing and the format is not the same as my index.html file. But when I put the page1.html file on the same folder as my index.html, it is working fine and the format and images are the same.


The reason for this is the folder structure and the area in your code that links to your images.

You need to adjust the link to your images to the new folder structure like this:

If in your index.html the structure is like this:

<img src="/img/image.png" />

Then in your pages folder that would be

<img src="../img/image.png" />

The ".." indicates going back one folder.

In case you mean your stylesheet with the word "format" you need to apply the same technique in your

<head><link rel="stylesheet" href="../stylesheet.css"></head>

The right path depends on your folder structure.