HTML 元刷新不会重定向到目标页面
HTML meta refresh won't redirect to targeted page
我正在尝试让我的 HTML 页面自动重定向到我学校的网站,但它不会这样做:
<!DOCTYPE html>
<html>
<head>
<style>
div.a {
text-align: center;
font-family: verdana;
height: 200px;
width: 400px;
position: fixed;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -200px;
}
div.b {
text-align: center;
font-family: verdana;
position: fixed;
bottom: 30px;
width: 100%
}
</style>
<meta charset="utf-8" , charset="ISO-8859-1" />
<meta http-equiv="refresh" , content="3" ; url="https://www.utad.pt/" />
<title>Redirecionando para Utad.pt</title>
</head>
<body>
<div id="Redirecionando" , class="a">
<strong>Aguarde, redirecionando-o para Utad...</strong>
<br>
<br>
<img src="http://moodle.utad.pt/theme/evolved/layout/includes/hmmm1/img/logo-big.png" ; align="center" ; width="135px" ; height="120px" />
</div>
<div id="manual" class="b">
Caso a página não carregue: <a href="https://utad.pt/">Utad.pt</a>
</div>
</body>
</html>
页面每3秒刷新一次,但拒绝重定向。我想说我没有做错任何事,但如果没有做错,那就意味着我在某个地方搞砸了。
您需要更改 meta
http-equiv
标记中的 content
属性值以包括刷新间隔和 url。像这样:
<meta http-equiv="refresh" content="3; url=https://www.utad.pt/" />
我正在尝试让我的 HTML 页面自动重定向到我学校的网站,但它不会这样做:
<!DOCTYPE html>
<html>
<head>
<style>
div.a {
text-align: center;
font-family: verdana;
height: 200px;
width: 400px;
position: fixed;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -200px;
}
div.b {
text-align: center;
font-family: verdana;
position: fixed;
bottom: 30px;
width: 100%
}
</style>
<meta charset="utf-8" , charset="ISO-8859-1" />
<meta http-equiv="refresh" , content="3" ; url="https://www.utad.pt/" />
<title>Redirecionando para Utad.pt</title>
</head>
<body>
<div id="Redirecionando" , class="a">
<strong>Aguarde, redirecionando-o para Utad...</strong>
<br>
<br>
<img src="http://moodle.utad.pt/theme/evolved/layout/includes/hmmm1/img/logo-big.png" ; align="center" ; width="135px" ; height="120px" />
</div>
<div id="manual" class="b">
Caso a página não carregue: <a href="https://utad.pt/">Utad.pt</a>
</div>
</body>
</html>
页面每3秒刷新一次,但拒绝重定向。我想说我没有做错任何事,但如果没有做错,那就意味着我在某个地方搞砸了。
您需要更改 meta
http-equiv
标记中的 content
属性值以包括刷新间隔和 url。像这样:
<meta http-equiv="refresh" content="3; url=https://www.utad.pt/" />