2013-03-14 70 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