此时元素元素上不允许使用属性名称 [英] Attribute name not allowed on element meta at this point

查看:393
本文介绍了此时元素元素上不允许使用属性名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里多次出错

<meta name="description" content="Directus Media specialises in websites for small to medium businesses">​

http://validator.w3.org/check?uri=http%3A%2F%2Fcrimsoninformatics.info%2Fdirectus%2F&charset=% 28detect +自动%29& doctype =内联& group = 0& user-agent = W3C_Validator%2F1.3 + http%3A%2F%2Fvalidator.w3.org%2Fservices

此外,链接属性错误:

我写道: -

<link rel="stylesheet"  href="css/lib/essentials.css"/>

它给我一个链接缺少必需属性的错误。

And it gives me error that link is missing required property.

请帮助我,因为我不熟悉HTML5。

Please help as i am new to HTML5.

推荐答案

两个 meta 标签, name =description的标签和 name =keywords的标签,页面包含字节0xE2 0x80 0x8B(和一些空格)。该页面被解释为UTF-8编码,但该字节序列是格式错误的UTF-8(不代表任何字符)。显然,验证器仍然将其解释为数据字符。这会导致 head 元素过早关闭,剩下的就是......好吧,不是历史,而是这种混乱的后果。 meta 标记中的第二个被视为位于正文部分,并且有特殊规则适用,制作标记无效。

Between two meta tags, the one with name="description" and the one with name="keywords", the page contains the bytes 0xE2 0x80 0x8B (and some whitespace). The page is being interpreted as UTF-8 encoded, but that sequence of bytes is malformed UTF-8 (does not represent any character). Apparently, the validator still interprets it as a data character. This causes the head element to be prematurely closed, and the rest is… well, not history, but a consequence of this confusion. The second of the meta tags is taken as being in the body part, and there special rules apply, making the tag invalid.

无论如何,真正的问题是存在虚假字节0xE2 0x80 0x8B。当它们被删除时,页面会被验证。

The real problem, anyway, is the presence of the bogus bytes 0xE2 0x80 0x8B. When they are removed, the page validates.

从外部知道产生这些字节的内容是不可能的。但是他们看起来很像一个字符编码错误,可能是因为对UTF-8编码的某些数据执行了错误的UTF-8编码,或类似的东西。

It is impossible to know, from outside, what produces those bytes. But they look suspiciously like a character encoding error, possibly causes by incorrectly performed UTF-8 encoding of some data that was already UTF-8 encoded, or something like that.

这是一个棘手的问题。我不得不使用Rex Swain的 HTTP Viewer 来检查违规页面

This was a tricky issue. I had to use Rex Swain’s HTTP Viewer to check the raw data of the offending page.

这篇关于此时元素元素上不允许使用属性名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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