简体   繁体   English

我应该避免在html中使用http-equiv =“ content-type”元标记吗?

[英]Should I avoid the usage of the http-equiv=“content-type” meta tag in html?

I see some people recommending putting in the head of all of their html. 我看到有人建议将所有html放在标题中。 Our server is sending a content-type http header, so I dont believe this is needed. 我们的服务器正在发送内容类型的http标头,因此我认为这不是必需的。 Am I correct? 我对么? Are their any reasons to keeping the meta tag? 他们有保留元标记的任何理由吗?

A reason I wish to remove it is because Google mentions that IE8 may suffer in performance if content-type is defined in a meta http-equiv tag rather than in http headers. 我希望删除它的原因是因为Google提到如果在meta http-equiv标签而不是在HTTP标头中定义content-type,IE8的性能可能会受到影响。 https://developers.google.com/speed/docs/best-practices/rendering?hl=it#SpecifyCharsetEarly https://developers.google.com/speed/docs/best-practices/rendering?hl=it#SpecifyCharsetEarly

There's no need to put it there if your server is setting the correct headers. 如果您的服务器设置了正确的标头,则无需将其放置在此处。 The headers are the preferred, standard way of setting the content type. 标头是设置内容类型的首选标准方法。

BTW don't forget to accurately put your charset in the content type too! 顺便说一句,不要忘记也将您的字符集准确地放在内容类型中!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 什么是<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” /> ? - What is <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />? <meta charset="utf-8">对比<meta http-equiv="Content-Type"> - <meta charset="utf-8"> vs <meta http-equiv="Content-Type"> HTML meta http-equiv未显示 - HTML meta http-equiv not showing up 使用元http-equiv标记重定向时,避免将页面添加到浏览器历史记录中 - avoid a page being added to browser history when redirecting using a meta http-equiv tag 如果在meta标签中设置了http-equiv,为什么不设置name属性? - Why should name attribute not be set if http-equiv is set in meta tag? 没有http-equiv元标记且字符集的HTML文件可能不是UTF-8 - HTML files with no http-equiv meta tag and the charset may be other than UTF-8 为什么是<meta HTTP-EQUIV="“Content-Script-Type”" …>大部分未使用? - Why is <META HTTP-EQUIV=“Content-Script-Type” …> mostly unused? 是 <html lang=“de-DE”> 等于 <meta http-equiv=“language” content=“DE”> ? - Is <html lang=“de-DE”> equal to <meta http-equiv=“language” content=“DE”>? 通过PHP标头或HTML元http-equiv发送文档信息? - Sending document information by PHP header OR HTML meta http-equiv? 如果我使用<meta http-equiv="“refresh”" content="“”">在没有时间值的情况下强制页面刷新是否有效 - if I use <meta http-equiv=“refresh” content=“”> to force a page refresh without a time value will it work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM