元标记无效的属性属性

发布于 2024-12-07 04:30:34 字数 861 浏览 0 评论 0原文

当我在 Facebook 上发布网站网址时,我试图更改 Facebook 使用的默认缩略图。现在我已经访问了几个网站/论坛,并且存在很多困惑/差异。 大多数人说您应该在主页的 标记中包含以下行:

<link rel="image_src" href="url to your desired thumbnail image.jpg" />

现在我这样做了(许多其他人也这样做了),但事实并非如此工作(也为其他人)。不同网站上的其他一些人建议包括以下内容:

<meta name="fb" content="url to your desired thumbnail image.jpg" property="og:image"/>

在 ASP.NET (Visual Studio '10) 中,它表示 'property' 不是 'meta' 的有效属性

现在我应该在 html 标签中声明什么模式才能使属性成为“有效”属性。我去一些大网站查看他们的编码,发现 标签中声明了以下元标签:

<meta content="IE=100" http-equiv="X-UA-Compatible">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

我也尝试过,但 fb 仍然不使用我指定的图片用作缩略图。我的编码和网址没有损坏或任何东西,Visual Studio 调试它没有问题。

请帮忙...

谢谢

I'm trying to change the default thumbnail pic facebook uses when I post my website url on fb. Now I've been on a couple of websites/forums and there is a lot of confusion/differences about it.
Most people say that you should include the following line in the <head></head> tag of your homepage:

<link rel="image_src" href="url to your desired thumbnail image.jpg" />

Now I did that (and so did many other people) and it doesn't work(for others as well). Some other folks on different websites suggested including the following:

<meta name="fb" content="url to your desired thumbnail image.jpg" property="og:image"/>

In ASP.NET (visual studio '10) it says that 'property' is not a valid attribute of 'meta'.

Now what schemas should I declare in my html tags for property to be a 'valid' attribute. I went on some big websites to see their coding, and found the following meta tags declared in the <head> tag:

<meta content="IE=100" http-equiv="X-UA-Compatible">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

I tried that as well but fb still doesn't use the pic I specified to be used as the thumbnail. My coding and url's are not broken or anything, visual studio debugs it without problems.

Please help...

Thank You

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜吻♂芭芘 2024-12-14 04:30:34

尝试将以下 标记添加到 部分:

<meta property="og:image" content="URL_to_your_desired_thumbnail_image.jpg" />

然后,在 Facebook URL Linter

使“property”成为 标签,您可能需要更改

Try adding the following <meta> tag into your <head> section:

<meta property="og:image" content="URL_to_your_desired_thumbnail_image.jpg" />

Then, enter the URL of your page into the Facebook URL Linter

For 'property' to be a valid attribute of the <meta> tag, you might have to change your <!DOCTYPE ...>.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文