Home / Articles / Programming languages / Markup languages / HTML & CSS / Links within a page in HTML

Links within a page in HTML

Links within a page in HTML
 
Links within a page in HTML
  • Currently 4 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 4/5 (1 votes cast)

Thank you for rating!

You have already rated this page, you can only rate it once!

Your rating has been changed, thanks for rating!

Log in or create a user account to rate this page.


Large documents are easier to read if they have a table of contents with links to relevant sections. To create a link first create a bookmark in the desired place and name it with parameter name of the a tag, as shown in example 1.

Example 1. Creating an internal link.

<a name="top"></a>
Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example. Just text for example... 
<a href="#top">Up</a>

Between the tags <a name="top"> and </a> there is a blank, because all you need to do is to specify the position of the link on the page, located at the bottom. The link name for the bookmark starts with # sign followed by the name of the bookmark. Any relevant name to the topic can be chosen.

You can also create link for a bookmark, which is located on another web page or even another site. To do this, in the link's address specify the address, and at the end add a pound sign # and the bookmark's name (example 2).

Example 2. Link to a bookmark on another web page.

<a href="text.php#bottom">Go to bottom of the text</a>

This example shows how to create a link to the file text.php. When you open the file, you go to the bookmark with the name "bottom". 


 

Read also

How to create a link in HTML

How to create a link in HTML

Parameter target in HTML

Parameter target in HTML

Image as a link in HTML

Image as a link in HTML

Post comment

basicuse.net
html5_css
106160485398655174790

Quick navigation

General navigation