< head>< / head>中的标签顺序 [英] Order of tags in <head></head>

查看:105
本文介绍了< head>< / head>中的标签顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< link> 或< script> < meta> 标记位于< head>< / head>

(愚蠢的问题,但其中一件事,我从来没有给过任何想法,直到现在。)

(daft question but one of those things i've never given any thought to until now.)

推荐答案

接受的答案 有错,取决于文档的编码。如果HTTP头中没有发送编码,浏览器必须从文档本身确定编码。

The accepted answer is kind of wrong, depending on the encoding of the document. If no encoding is sent by in the HTTP header, the browser has to determine the encoding from the document itself.

如果文档使用< ; meta http-equiv =Content-Type... 声明声明其编码,然后在此语句必须之前出现的任何ASCII值字符(字符代码<128)是一个ASCII值,如 HTML 4规范所示。因此,这个 meta 声明出现在任何其他可能包含非ASCII字符的元素之前是很重要的。

If the document uses a <meta http-equiv="Content-Type" … declaration to declare its encoding, then any ASCII-valued character (character code < 128) occurring before this statement must be an ASCII value, as per HTML 4 spec. Therefore, it's important that this meta declaration occurs before any other element that may contain non-ASCII characters.

这篇关于&lt; head&gt;&lt; / head&gt;中的标签顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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