Html validation error for property attribute(属性属性的 HTML 验证错误)
问题描述
我正在使用一些 facebook 社交插件,并且正在使用元标题.验证页面时,W3C 验证器抛出错误 -> 错误:没有属性属性".
I am using few facebook social plugins and I am using the meta header. When validating the page, the W3C validator is throwing the error -> "Error: there is no attribute "property".
我正在使用 XHTML 过渡文档类型 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I am using the XHTML Transitional doctype - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
请建议我是否必须将文档类型更改为其他内容.
Pls Suggest if I have to change the doctype to something else.
推荐答案
Facebook的插件使用Open Graph,它是内置的在 RDFa 上.是 RDFa 将 property
属性添加到元素.没有这个添加,纯 HTML 就没有这样的属性.(如果你问我,添加一个新属性而不给它命名空间,并重复使用 <meta>
标记的一半,这是一个奇怪的设计.但没有人这样做.)
Facebook's plugins use Open Graph, which is built on RDFa. It's RDFa that adds the property
attribute to elements. Without this addition, plain HTML has no such attribute. (If you ask me, it's a strange design to add a new attribute without namespacing it, and to re-use half of a <meta>
tag. But no-one did.)
要验证 XHTML-with-RDFa,您需要 DOCTYPE:
To validate XHTML-with-RDFa, you'll need the DOCTYPE:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
这意味着您必须编写有效的 XHTML 1.1.更多
This means you will have to be writing valid XHTML 1.1. More
这篇关于属性属性的 HTML 验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:属性属性的 HTML 验证错误


基础教程推荐
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01