-1

Im trying to get this basic image to show up on my webpage but it just wont for some stupid reason. I have my .html file in the same folder as my images folder but idk if what im doing wrong

<!DOCTYPE html>

<html>
    <head>
        <title>Title</title>
    </head>

    <body>
        <header>
            <h1>this is a website</h1>
        </header>

        <main>
            <article>
                <h2>
                    First page of the first page
                </h2>
                <p>
                   below is a picture of a slime
                </p>

        <img src="imagesFolder/slime.png" alt = "this is a picture of a slime">


            </article>
        </main>
    </body>
3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented yesterday
  • If the folder name has a space in the middle you have to add it like this images%20Folder/slime.png or else check the file path. Commented yesterday
  • 1
    Nothing is wrong, with your sample. (However, I would prefer closing all the tags.) There can be some other reason for the problem: the relative path name of the file slime.png can be wrong, or the content of the file itself can be wrong. Commented yesterday

2 Answers 2

0

Try using DevTools to figure out what’s going wrong.

Press F12 (or right-click and choose Inspect) and check the Console for red error messages — for example, a 404 means the image wasn’t found, usually because the path or filename is wrong.

Next, go to the Network tab and reload the page. Filter by Img and look for errors like 404 (file not found) or 403 (access denied).

You can also right-click the <img> in the Elements tab and choose "Open in new tab". If the image doesn’t load there, the file path or name is likely incorrect.

0

I think imagesFolder/slime.png is the folder name followed by file name. If the image is in sam folder i think specifying the file name that is slime.png is enough

New contributor
Rashmi C Naik is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented yesterday

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.