SimpleTuts.com

Hyperlinks to same page using bookmarks

Create a webpage with bookmarks

Create an HTML file and give the names of four or five fruits as headings. Then give a few nested content paragraphs below each heading. Then add bookmark with ID to each heading. After that you can link to those bookmarks as shown below


<html>

<head>
    <title>Hyperlink to Bookmarks</title>
</head>

<body>

    <h1 id="index">Index</h1>
    <a href="#apl">Apple</a> |
    <a href="#org">Orange</a> |
    <a href="#grp">Grapes</a>
    <hr>

    <h1 id="frt">Fruits</h1>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <a href="#index">Go to top</a>

    <h1 id="apl">Apple</h1>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <a href="#index">Go to top</a>

    <h1 id="org">Orange</h1>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <a href="#index">Go to top</a>

    <h1 id="grp">Grapes</h1>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <p>This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.This program is free software; you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by the Free 
    Software Foundation; either version 3 of the License, or at your option any 
    later version.</p>
    <a href="#index">Go to top</a>

</body>

</html>

Run Code

Watch video