Struggling to add images

Trying to add an image to my page, there are some errors (in HTML)

console.log('Hello world!');

!DOCTYPE html>


Sophie Napier

Kia Ora, my name is Sophie. I completed a bachelor of Communication studies at the University Of Waikato.

My passions include

  • Reading
  • Coding
  • Sustainability

To find out more visit Eco Soph

use the </> button and paste your code between the ``` and ```
for your code to show up correctly in the post.

Kia Ora Sophie!

Add images with the <img> element, and put in the relative path to your image file:

<img src="./relative/path/to/your/image/file.jpg">

It’s also considered best practice to include an alt attribute, for accessibility. Here is the MDN Web Doc on this element.

Happy coding :slight_smile:


Hm still not working, but I will keep experimenting

Hi Sophie!

It looks like you have a broken link where your image should be. Have you typed the URL correctly? Typos are a common cause of frustration. Also make sure you are using the correct relative path.

Feel free to share your code, and a screenshot of your file structure so we can help further.

Happy coding :slight_smile:

So I had an image load properly, then I tried to make it fancy and make it clickable. Now its not showing?

1 Like

It looks like the end of the a tag is missing.
<a href="http://Gallery.html"
should be
<a href="http://Gallery.html">