How Viber select the image to display from HTML page(Viber 如何从 HTML 页面中选择要显示的图像)
问题描述
当我通过 Viber 向某人发送一些 URL 时,Viber 会加载 URL 并显示代表 HTML 页面的图像.
when I send some URL to someone via Viber the Viber load the URL and displays image representing the HTML page.
如何告诉 HTML 页面应该是什么图像?
How to tell the HTML page what image it should be?
推荐答案
你应该使用 Open Graph 协议.您可以简单地将这段代码添加到您的页面<head>
:
You should use Open Graph protocol. You can simply add this snippet to your page <head>
:
<meta property="og:type" content="website">
<meta property="og:site_name" content="Название сайта">
<meta property="og:title" content="Заголовок">
<meta property="og:description" content="Описание.">
<meta property="og:url" content="http://example.com/page.html">
<meta property="og:locale" content="ru_RU">
<meta property="og:image" content="http://example.com/img.jpg">
<meta property="og:image:width" content="968">
<meta property="og:image:height" content="504">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Заголовок">
<meta name="twitter:description" content="Описание.">
<meta name="twitter:image:src" content="http://example.com/img.jpg">
<meta name="twitter:url" content="http://example.com/page.html">
<meta name="twitter:domain" content="example.com">
<meta name="twitter:site" content="@">
<meta name="twitter:creator" content="@...">
图片尺寸应为 968x504 像素.阅读更多这里
Image size should be 968x504px. Read more here
干杯!
这篇关于Viber 如何从 HTML 页面中选择要显示的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Viber 如何从 HTML 页面中选择要显示的图像


基础教程推荐
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01