Skip to main content
gamedev.net
🔒 Locked

Images

Started by Kk1496 0 replies 1.8k views
Original Post
Kk1496
Kk1496

I have an image that i'm using as a header on a website so, i need it to appear on each page. I got the image to appear on the home page. However, when I copy and pasted the code for the image, it doesn't appear on the net page. Is there some rule about using the image twice? is their a better way to go about doing this?

<div>
<img src="../IMG/logo.png" alt="Summer Employment Experience logo" width="100%"/>
</div>
DiegoSLTS
DiegoSLTS

There's no rule about it, if the image is in the right place it should be displayed. Use the tools on your browser to check where is it looking for the image, it looks like a simple problem with the resulting URL that's used to request the actual image. Check the URL of the working image and the the URL of the broken one and you'll found how to fix it.

Consider that "../IMG/logo.png" means that the image path is built relative to the html file location, so, if you have your html file at "<path>/src" folder then the image should be in "<path>/IMG" folder, but it could depend on other stuffs too (like the base tag or some stuffs that frameworks might do).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.