HTML5:标题前的元字符集? [英] HTML5: Meta charset before title?

查看:68
本文介绍了HTML5:标题前的元字符集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常看到这个:

<head>
<meta charset="utf-8">
<title>Title</title>
...
</head>

将图表集定义放在title标签之前是否重要?

Is it important to put the chartset definition BEFORE the the title tag?

谢谢!

推荐答案

是,请参见

为了使所有浏览器都能识别<meta charset>声明, 一定是

In order for all browsers to recognize a <meta charset> declaration, it must be

  • <head>元素内,
  • 任何包含文本的元素之前,例如<title>元素和
  • 在文档的前512个字节内,包括DOCTYPE和空格
  • Within the <head> element,
  • Before any elements that contain text, such as the <title> element, AND
  • Within the first 512 bytes of your document, including DOCTYPE and whitespace

这篇关于HTML5:标题前的元字符集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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