W3C验证程序显示Facebook打开图错误 [英] w3c validator shows error for facebook open graph
问题描述
在w3c验证程序中验证我的网站时,出现2个错误.
I get 2 errors while validating my site in w3c validator.
第7行,第47列:此处不允许使用xmlns:og属性. xmlns:fb ="http://www.facebook.com/2008/fbml">
Line 7, Column 47: Attribute xmlns:og not allowed here. xmlns:fb="http://www.facebook.com/2008/fbml" >
第7行,第47列:本地名称为xmlns:fb的属性不能序列化为XML 1.0. xmlns:fb ="http://www.facebook.com/2008/fbml">
Line 7, Column 47: Attribute with the local name xmlns:fb is not serializable as XML 1.0. xmlns:fb="http://www.facebook.com/2008/fbml" >
我想这与Facebook开放图有关.我正在wordpress上运行我的网站,并在启用了社交功能的情况下在一个SEO包中使用了全部功能.禁用社交功能后,我的网站可以完美验证,没有错误.这个问题有解决办法吗? 这就是网站上的样子
I guess it is related with Facebook open graph. I'm running my site on wordpress and using All in one SEO pack with Social features enabled. When Social feature is disabled, my site validates perfectly with no errors. Is there any fix to this problem? This is how it looks on site
<!DOCTYPE html>
<!--// OPEN HTML //-->
<html lang="en-US"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml" >
<!--// OPEN HEAD //-->
<head>
<!--// SITE TITLE //-->
<title>Aton usluge | Licencirana agencija za kreditno posredovanje</title>
<!--// SITE META //-->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
以此类推.
推荐答案
xmlns
属性是您应该改用prefix
属性:
<html
prefix="og: http://ogp.me/ns#
fb: http://www.facebook.com/2008/fbml">
resp.如果要保留XHTML5的xmlns
:
resp. if you want to keep the xmlns
for XHTML5:
<html
xmlns="http://www.w3.org/1999/xhtml"
prefix="og: http://ogp.me/ns#
fb: http://www.facebook.com/2008/fbml">
这篇关于W3C验证程序显示Facebook打开图错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!