How to create a link of a page in HTML

What is HTML Link?

In HTML, a link is an element that allows you to navigate from one HTML document/page to another document/page, either within the same website or to an external resource on the internet.

HTML <a> (anchor) element is used to create a link in a webpage.

Example of Creating HTML Link

Create an HTML anchor element <a></a>.

Add the link text 'Visit xFactor School' between <a> and </a> tags.

Add href (hypertext reference) attribute within the anchor (<a>) element. Specify the URL (web address) to which the hyperlink points. Here the URL is "https://xfactorschool.com". It will look like this: <a href="https://www.xfactorschool.com/">.

Here is the complete link you have created so far.

Example of THML Link


Output of the above example


Create a simple webpage and add some elements and text along with the anchor link as shown in the following example.

Example of Link in an HTML Page


Output of the above example

Example of Link in HTML


Use HTML anchor (<a>) tag to create HTML Link.

Please click on the following link to check the hyperlink.

Visit xFactor School

Live Code Playground

In the following HTML code editor, you can practice the above code by creating more new HTML links. Click on the 'Run Code' button to render the code; the rendered page will be displayed in the following HTML Code Output frame. Practice until you become comfortable and proficient with your code.

HTML logo HTML Online Editor
HTML Code Output