All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

How To Link One Page To Another In HTML

Last Updated : Mar 11, 2024

How To Link One Page To Another In HTML

In this tutorial we will show you the solution of how to link one page to another in HTML, sometimes, we found on internet that there are some websites or webpages.

In which there is a link or button and when we click on that then webpage gets changed, this is done with the help of HTML links. In this we link one webpage to another webpage.

We are able to redirect user from one webpage to another webpage.

Step By Step Guide On How To Link One Page To Another In HTML :-

As, we discuss earlier that linking of one or more webpage is possible through with the help of HTML links. By using HTML links we are able to go next to next webpage as we want.

Here, an anchor is used in HTML for this job, in which its hyper-reference (href) attribute used.

We give the webpage name or its location with name of webpage with its extension as value. Here is a general use of anchor tag to link webpages with the help of codes is given here...

<!DOCTYPE html>
      <html>
        <head>
          <title> Title of the document</title>
        </head>
          <body>
    <a href=" pagename.extension">
           Click me
       </a>
   <a href="http://www.google.com/">
       This syntax is used to link online webpages
       </a>
          </body>
      </html>
  1. First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
  2. Secondly, the <html> tag is used to indicate the beginning of an HTML document.
  3. As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title.
  4. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
  5. Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here.
  6. Here, in the code in between body tag we use two anchor tags. At First, anchor tags are paired tags so it must have closing tag.
  7. The text written in between these tags in shown on screen and as default its color is blue and also underlined. Now, the link to another page is given by using an attribute href to anchor tag and the page name and its extension is given as value to this attribute.
  8. In second anchor tag, https// is used, if u want to provide an online link means that it the page where you want user to go is already on internet, then link starts from www… is given after this https//.
  9. At last, the <body> and <html> tags are closed with </body> and </html> respectively.

Conclusion :-

At last, here we can say that linking one page to another is not a difficult process. A page in linked to another page in different ways, which we discuss later, like in forms and as a button etc.

Anchor tag is the easiest way to link a webpage to another webpage. It is not mandatory that you can link one page to another one only.

You can also link one webpage to two or more than two webpages as you want. I hope this tutorial on how to link one page to another in HTML helps you.

Author Image About Pragati

Experienced coding content writer who enjoys breaking down complex concepts in programming languages like Java, Python, C, and C++. Over three years of experience producing interesting and relevant content for a variety of entities. Committed to providing concise and easy-to-understand articles that assist readers in easily understanding technology and industry trends in the world of coding and software development.

Follow Pragati On Linkedin 🡪