1
votes

I am a beginner coder trying to create a website where the logo is hyperlinked to the homepage. The logo image renders normally at first, but when I click on on the logo it takes me back to the homepage with an broken image. The path is accurate for the image, as is the home page's path, so I'm fairly stumped.

HTML:

<a href='./HomePage.html'><img src="./MainLogo.jpg" alt="AVC Logo"/></a>
2

2 Answers

0
votes

If everything is in the same directory remove './' from href and from src

<a href='HomePage.html'><img src="MainLogo.jpg" alt="AVC Logo"/></a>
0
votes

A good way to name the home page is index.html and in your case type HomePage.html

<a href='HomePage.html'><img src="./MainLogo.jpg" alt="AVC Logo"/></a>

the best way is

<a href='index.html'><img src="./MainLogo.jpg" alt="AVC Logo"/></a>