You can use the meta tag to redirect from an HTML page. Also, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value in the content is the number of seconds; you want the page to redirect after.
For immediately loading you can set the content attribute to 0
<html> <head> <title>HTML Meta Tag</title> <meta http-equiv = "refresh" content = "2; url = https://www.tutorialspoint.com" /> </head> <body> <p>Hello HTML5!</p> </body> </html>
Try the examples yourself here
Yes. You can achieve it in 2 ways:
You can simply inlcude the following meta tag in
<head> of the HTML document:
<meta http-equiv="refresh" content="0; url=https://example.com/" />
Note that, you can change value
0 to what you like, which represents the delay in number of seconds.
By simply adding
- Exisitng element, say,
<body onload="window.location.href = 'https://example.com';"> ... </body>
- New element, say,
<div onload="window.location.href = 'https://example.com';"> ... </div>
Hope it helps!
The simplest way to redirect to another URL is to use an HTML meta tag with the http-equiv parameter set to “refresh”. The content attribute sets the delay before the browser redirects the user to the new web page. For redirect to occur immediately, set this parameter to “0” seconds for the content attribute.
<meta http-equiv="Refresh" content="0; url=https://www.w3docs.com" />
If you want your redirect to occur in an exact time, just define your preferred parameter (in seconds) for the content. Let’s consider an example set with 7 seconds redirect time set.
I suggest you to try the following
<meta http-equiv="refresh" content="0; url=http://example.com/" />
Also, please note, place it in the head section. Also, for older browsers ;
will appear as Redirect, You will be allowed to go with an additional click.
- 3Anchor Link for Jumping to a Specific Part of a Page
- 5What is "marquee" tag and how I can use it in HTML?
- 1How to make redirect to occur in an exact time
- 4What FREE web hosting to use
- 3Make a website page refresh everyone 5 seconds
- 1How to make my footer cover 100% height and width of the page from top?
- 1Is it possible to view a git log of commits of just one user?
- 3Is it possible to create an HTML button that acts like a link to an item on the same page?
- 10Is it possible to create an HTML button that acts like a link?
- 2How can I set an HTML text input to allow only numeric input?