属性属性的Html验证错误 [英] Html validation error for property attribute

查看:84
本文介绍了属性属性的Html验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是少数Facebook社交插件,我正在使用meta标题。验证页面时,W3C验证器抛出错误 - >错误:没有属性属性。

我使用的是XHTML Transitional doctype - <!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">



建议如果我必须将doctype改为别的。

解决方案

Facebook的插件使用基于RDFa的 Open Graph ,它的RDFa增加了属性属性为元素,如果没有这个添加,纯HTML没有这样的属性(如果你问我,添加一个没有命名空间的属性是一个奇怪的设计,重复使用< meta> 标记的一半,但没有人做过。)



验证XHTML-with-RDFa,你需要DOCTYPE:

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

这意味着您必须编写有效的XHTML 1.1。 更多


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".

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'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.)

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">

This means you will have to be writing valid XHTML 1.1. More

这篇关于属性属性的Html验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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