Index Scroll in HTML

I have created pages with overflow: auto; mode & with various sections for example;

Top - LandTransport
Next - RailTransport
Next - WaterTransport
Next - AirTransport

I would like to create an index similar to this;

<button><a href="/LandTransport">LandTransport</a></button> <button><a href="/RailTransport">RailTransport</a></button> <button><a href="/WaterTransport">WaterTransport</a></button> <button><a href="/AirTransport">AirTransport</a></button>

Im unsure if the tags that I have used are correct. This website does not provide any rule.

I am familiar with href jumping to another page but I dont want that.

If a button is clicked I want the page to jump scroll to the appropriate section on the same page.

Is there some simple HTML code that will achieve that?

I have Googled several times but cant find anything.

You can use a hash tag to jump to an element with the corresponding I’d on the same page, like so:

<h1 id="my_anchor">Place you want to jump to</h1>
A load of other content...










<a href="#my_anchor">Go back to the anchor</a>

Thanks @skawid. Ive got it to work although not precisely the way I wanted, however the variation is negligible.

Would you care to look at my other problem at How to delete line after a time lapse?

I have not been able to obtain any solution.

Sponsor our Newsletter | Privacy Policy | Terms of Service