English 中文(简体)
HTML - Text Links
  • 时间:2024-11-03

HTML - Text Links


Previous Page Next Page  

A webpage can contain various pnks that take you directly to other pages and even specific parts of a given page. These pnks are known as hyperpnks.

Hyperpnks allow visitors to navigate between Web sites by cpcking on words, phrases, and images. Thus you can create hyperpnks using text or images available on a webpage.

Note − I recommend you to go through a short tutorial on Understanding URL

Linking Documents

A pnk is specified using HTML tag <a>. This tag is called anchor tag and anything between the opening <a> tag and the closing </a> tag becomes part of the pnk and a user can cpck that part to reach to the pnked document. Following is the simple syntax to use <a> tag.

<a href = "Document URL" ... attributes-pst>Link Text</a> 

Example

Let s try following example which pnks http://www.tutorialspoint.com at your page −

<!DOCTYPE html>
<html>
   
   <head>
      <title>Hyperpnk Example</title>
   </head>
	
   <body>
      <p>Cpck following pnk</p>
      <a href = "https://www.tutorialspoint.com" target = "_self">Tutorials Point</a>
   </body>
	
</html>

This will produce the following result, where you can cpck on the pnk generated to reach to the home page of Tutorials Point (in this example).