< meta charset =" utf-8"> vs< meta http-equiv =" Content-Type"> [英] <meta charset="utf-8"> vs <meta http-equiv="Content-Type">

查看:209
本文介绍了< meta charset =" utf-8"> vs< meta http-equiv =" Content-Type">的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了定义 HTML5 Doctype 的字符集,我应该使用哪种表示法?

In order to define charset for HTML5 Doctype, which notation should I use?


  1. Short:

  1. Short:

<meta charset="utf-8" /> 


  • 长:

  • Long:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    



  • 推荐答案

    在HTML5中,它们是等效的。使用较短的一个,它更容易记住和键入。 浏览器支持很好,因为它是为向后兼容而设计的。

    In HTML5, they are equivalent. Use the shorter one, it is easier to remember and type. Browser support is fine since it was designed for backwards compatibility.

    这篇关于&lt; meta charset =&quot; utf-8&quot;&gt; vs&lt; meta http-equiv =&quot; Content-Type&quot;&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆