How To Navigate To Another Page In HTML
Last Updated : Jul 1, 2023
IN - HTML
In this tutorial we will show you the solution of how to navigate to another page in HTML and how you are able to navigate from one page to another page in HTML.
From this question, we can arise another question that is how to link webpages to each other because when you have to navigate from one page to another, the pages must be linked with each other. Now, let us understand how we can do this.
Step By Step Guide On How To Navigate To Another Page In HTML :-
The tag which is used here is named as anchor tag. Anchor tag is used for the purpose to navigate between webpages in HTML.
You can use any one like text, button, image and what you want to navigate.
Here below we are going to show you codes in html which explain you how to use anchor tag for navigation.
<!DOCTYPE html> <html> <head> <title> Title of the document<title> </head> <body> <a href="http://www.google.com"> click here to open google </a> <br><br> <a href="project/one.html"> <img src=”this.jpeg”> </a> <br><br> <a href="takerscode.com "> <button> Button, click me </button> </a> </body> </html>
- First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
- Secondly, the <html> tag is used to indicate the beginning of an HTML document.
- 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.
- Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
- Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here.
- Here, in body we show you how to use anchor tag to navigate to another page. Here, in this article we create three anchor tags and they all are different.
- In first anchor tag, user is navigated to google home page when he/she clicks on the text.
- In next case you will see an image there and where you clicks on this image you are redirected to html file under project folder with name this.
- And at last you will see a button on webpage with text button, click me. and when user clicker on the button. He/she will be redirected to index page of talkerscode.com.
- We hope that you understand how we will use anchor tag to navigate.
- For navigation you just have to write the link of file in href attribute of anchor tag and all gets done. There are many attributes of anchor page for them you must have to visit our webpage with topic attribute of anchor tag.
- At last, the <body> and <html> tags are closed with </body> and </html> respectively.
At last in conclusion, here we can say that with the help of this article we are able to navigate to another page in html. I hope this tutorial on how to navigate to another page in HTML helps you.