Search code examples
htmlimagehref

HTML Jump to certain part of another page by clicking on a part of an image


Okay so I just began with doing HTML/CSS/PHP for school. I made a webpage by just adding one image (made in Photoshop) and putting it in an image map. I have 2 buttons and they both are clickable and need to redirect to another page. All my webpages contain only one image. Now my question is, how to jump to another page and reaching the bottom of this image (bottom of the page) when clicking on one of the buttons? (If I click on one of the buttons it automatically loads the next page at the top)

Hope one of you guys can help me out here!

EDIT:

added images from comments because they contains the code:

enter image description here

and

enter image description here


Solution

  • You have to add an element with an id below that image and then add the id to the link.

    This is the link:

    <a href="otherpage.html#bottom">Link to image</a>
    

    This is the other page:

    <img src="img/yourimage.png" /><div id="bottom"></div>