![]() |
|
HTML page refreshing and redirecting, Free online HTML Tutorial, Learn HTML online for free... |
| Lessons | Refreshing and Redirecting |
|
|
Note that the refresh meta tag must come before the <title> tag, else it will not work. You can add the following code to refresh your web page after 2 seconds: <meta http-equiv="refresh" content="5"> This page will automatically refresh in 5 seconds. You can increase / decrease the time before refresh by using the content attribute of the above meta tag. Suppose you have moved you web page, for some reason, and you want to automatically redirect your visitors to the new address, you could achieve your purpose by adding the followin code to your web page: <meta http-equiv="refresh" content="2 ;URL=http://www.domainname.com/new.htm"> The page will automatically redirect in 2 seconds. The content attribute tells the browser to go to the specified URL in 2 seconds. For a redirect 2 seconds are enough, but for a refresh you might need to increase the number of seconds before the page refreshes. The number of seconds and the URL are seperated by the use of a semicolor (;). Note that URL is not a seperate attribute of the above meta tag.
Next >>> Lesson No. 36: Less Known HTML Tags
|