<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Test Title</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
为什么两个 meta 标签总是在 title 之前,其他标签在之后?
是否有任何原因(兼容性、编码引用或规则)我不能将所有元标记放在标题之前?
最佳答案
浏览器需要尽快知道字符编码。其他元素(包括标题)可以包含仅在所使用的特定编码中具有意义(或正确意义)的字符。
没有必要在标题前出现任何其他元元素。
Is there any reason (compatibility, coding references or rules) I can't place all the meta tags before title?
标题越早出现,浏览器就能越早显示它(在标题栏、选项卡等中)。
关于html - 为什么 <meta> 和 <title> 标签是这样排序的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12355613/