Anders Metnik
Anders Metnik

Reputation: 6237

My picture doesnt show up? (newbie Q)

File structure:

file structure

Code :

    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Metnik EL Logo</title>
    </head>
    <body>
        <img src ="/images/metnikElHeaderLogo.jpg" alt="metnikHeadLogo" />
    </body>
</html>

Really dont understand what im doing wrong.. Btw have tried with ../images and tried with setting height and width aswell.

Upvotes: 0

Views: 90

Answers (2)

Vladimir Starkov
Vladimir Starkov

Reputation: 19803

You use absolute path to image, and in your case you must use relative path (further reading)

in your case you must use this notation

<img src ="./images/metnikElHeaderLogo.jpg" alt="metnikHeadLogo" />

where is:

"./" — relative path begining string, meaning that path located in the same folder, as an file, where string was written

"images/" subfolder in the same folder

Upvotes: 0

Stef Robinson
Stef Robinson

Reputation: 377

From index.jsp, the path to your image should be

<img src ="images/metnikElHeaderLogo.jpg" alt="metnikHeadLogo" />

From other files within the "pages" folder, then you will need:

<img src ="../images/metnikElHeaderLogo.jpg" alt="metnikHeadLogo" />

Upvotes: 2

Related Questions