2013-03-14 69 views
2

我编辑的职位,以及许多变化,我有1error:没有属性XW3C验证错误:没有属性X

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Line 71, column 16: there is no attribute "property" 

<meta property='og:locale' content='en_US'/> 

我怎样才能解决这个问题?

谢谢先进。


1更新: 我更换

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 

有:没有任何更多

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

的错误,但我有其他错误。


2更新

我在header.php中更换

<meta http-equiv="content-language" content="en_US" /> 

到:

<meta http-equiv="content-language" content="en_us" /> 

,我已经做的第二件事: 在opengraph.php(Yoast插件)我替换了:

if ($echo) 
      echo "<meta property='og:locale' content='" . esc_attr($locale) . "'/>\n"; 
     else 
      return $locale; 

到:

if ($echo) 
      echo "<meta property='og:locale' content='en_us'/>\n"; 
     else 
      return $locale; 

但结果是一样的。 1错误。

回答

2

<meta>标记没有名为“property”的属性。您似乎在使用W3C的HTML验证器验证Open Graph协议标记。这几乎保证不起作用。查看Facebook's debugger tool可能会有所帮助。它应该提供关于OG标记的反馈。

+0

感谢您的回答。我验证Open Graph协议,我没有任何错误。这可能是问题? – miked 2013-03-15 01:04:12

+0

我更新了第一篇文章。 – miked 2013-03-15 01:25:32

+0

Guy的任何解决方案? – miked 2013-03-15 11:40:37