QQ分享、社交分享自定义图片和标题

本文由清尘发表于2017-06-30 16:50属于移动前端分类

效果:

代码:

<head>
    <meta charset="UTF-8">
    <meta name="keywords" content="剑网三奇穴查看器" />
    <meta name="description" content="剑网三奇穴查看器" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta itemprop="name" content="剑网三奇穴查看器"/>
    <meta itemprop="image" content="src/share.jpg" />
    <title>轻寒 - 剑网三奇穴查看器</title>
    <link rel="stylesheet" type="text/css" href="src/style.css">
</head>

shart.jpg 图片为分享前的小图标 330X330

页面底部增加图片的URL地址

<img class="sns-share-img" style="display:none;" src="src/share.jpg">
<img class="wechat-share-img" style="display:none;" src="src/share.jpg">