Skip to content
Related Articles

Related Articles

Improve Article

How to redirect a page to another page in HTML ?

  • Last Updated : 11 Oct, 2019

To redirect from an HTML page to another page you can use the <meta> tag. It is the client-side redirection, the browsers request the server to provide another page. Also, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value in the content attribute is the number of seconds, you want the page to redirect after. For immediate loading, you can set it to 0. Some browsers don’t correctly render the refresh tag. There the user may see a message before the next page loading. Some old browsers don’t correctly refresh when you add such quick links. In that case, you should add an anchor link to let the user follow to next page.

Syntax:

<meta http-equiv = "refresh" content = " time ; url = link"/>

Examples:




<!DOCTYPE html> 
<html
  
<head
    <title>HTML Redirect</title
    <meta http-equiv="refresh"
        content="5; url = https://ide.geeksforgeeks.org" /> 
</head
  
<body
    <h1 style="text-align:center;color:green;"
         GeeksforGeeks 
    </h1
      
    <p style="text-align:center;"
        If your browser supports Refresh, 
        you'll be redirected to GeeksforGeeks 
        Homepage, in 5 seconds. 
    </p
</body
  
</html

Output:

Supported Browsers: The browsers supported by HTML Redirect are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :