If I want to redirect to another page in my HTML file, do in have to place the meta tag in the head
or can I place it at the top of the file before the DOCTYPE? Thank you.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
W3C deprecates the use it, but they do offer an example on W3C:
The meta tag has to be inside the
<head></head>
section. You can not add anything before<!DOCTYPE html>
Here is detailed description of DOCTYPE
GIYF: H76: Using meta refresh to create an instant client-side redirect
You can't place a
meta
tag above the DOCTYPE. The DOCTYPE must always be the first element in an HTML document, andmeta
tags must only be placed in thehead
.Source: http://www.w3.org/TR/html5/syntax.html#writing
For purposes of this question, the spec says that a document must start with a DOCTYPE and be followed by a root
html
element. While ameta
tag might still work, there is no guarantee of it doing so today and continuing to do so in the future.You should insert the following line in the head section of your HTML page, replacing http:example.com/ with the actual web page to which you want to redirect your viewers:
Here is an example with the correct line inserted in a typical HTML page. Note that it comes above the title tag.