简体   繁体   中英

HTML meta refresh won't redirect to targeted page

I'm trying to make my HTML page to redirect automatically to my school's website, but it won't do it:

 <!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> 

The page refreshes every 3 seconds, but it refuses to redirect. I want to say that I didn't do anything wrong, but if it's not doing it, it means I screwed up somewhere.

You need to change the content attribute value in your meta http-equiv tag to include both the refresh interval and the url. Like this:

<meta http-equiv="refresh" content="3; url=https://www.utad.pt/" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM