元标签属性错误

发布于 2024-12-02 21:43:18 字数 536 浏览 5 评论 0原文

我试图放置元数据:

<meta property="og:type" content="website"/>
<meta property="og:title" content="one title"/>    
<meta property="og:image" content="image.jg"/>    
<meta property="og:description"   content="news portal"/>

但我有错误: 错误 6 验证(XHTML 1.0 Transitional):属性“property”不是元素“meta”的有效属性。

我的文档类型是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

我不知道如何解决此错误,因为无法识别此属性。 谢谢。

Im trying to put the metas:

<meta property="og:type" content="website"/>
<meta property="og:title" content="one title"/>    
<meta property="og:image" content="image.jg"/>    
<meta property="og:description"   content="news portal"/>

But i have the error:
Error 6 Validation (XHTML 1.0 Transitional): Attribute 'property' is not a valid attribute of element 'meta'.

the doctype I have is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

I dont know how can i solve this error cause not recognize this attribute.
Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不…忘初心 2024-12-09 21:43:18

您有两个选择:

  1. 停止使用 Facebook 的非标准 HTML 扩展
  2. 使用引用包含 Facebook 的非标准 HTML 扩展的 DTD 的 Doctype(W3C 和 Facebook 均未提供)

You have two options:

  1. Stop using Facebook's non-standard extensions to HTML
  2. Use a Doctype that references a DTD that includes Facebook's non-standard extensions to HTML (Neither the W3C nor Facebook provide one)
聊慰 2024-12-09 21:43:18

我的页面根据标准 DOCTYPE 进行验证,并且它们包含给您带来麻烦的 Facebook 元数据。我正在使用更高版本的 XHTML。

然而,我确实必须欺骗验证器忽略“赞”按钮。

大卫

My pages validate against a standard DOCTYPE and they contain the Facebook metadata that's causing you trouble. I'm using a later version of XHTML.

I did, however, have to trick the validator into ignoring the Like button.

David

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文