第一步,在想要展示的位置添加HTML,一般侧栏最好,里面的url为点击后跳转到的网页。
<div class="textwidget custom-html-widget"><div class="qqg-card-widget" id="qqg-card-wechat" onclick="window.open('https://www.3qpd.com');"> <div id="qqg-flip-wrapper"> <div id="qqg-flip-content"> <div class="qqg-face"></div> <div class="qqg-back qqg-face"></div> </div></div></div></div>
第二步,添加CSS到全局css文件中,添加之后需要修改图片url地址,素材图片在附件下载。
/* wxgzh-card-shadow */ .wx-card-widget { box-shadow: 0 8px 16px -4px #2c2d300c; background: #fff; border: 1px solid #e3e8f7; transition: 0.3s; border-radius: 12px; transition: 0.3s; position: relative; overflow: hidden; margin-top: 1rem; padding: 1rem 1.2rem; } /* wxgzh-fanzhuan */ #wx-flip-wrapper { position: relative; width: 235px; height: 110px; z-index: 1; } #wx-flip-content { width: 100%; height: 100%; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; transition: cubic-bezier(0, 0, 0, 1.29) 0.3s; } #wx-flip-wrapper:hover #wx-flip-content { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); } .wx-face { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; background: url(/wx_face.png) center center no-repeat; background-size: 100%; } .wx-back.wx-face { display: block; -webkit-transform: rotateY(180deg); transform: rotateY(180deg); box-sizing: border-box; background: url(wx_code.png) center center no-repeat; background-size: 100%; } /* wxgzh-background */ .wx-card-widget#wx-card-wechat::before { position: absolute; width: 100%; height: 100%; left: 0; top: 0; background: url(gzh_cover.png) center center no-repeat; content: ''; } .wx-card-widget#wx-card-wechat { background: #57bd6a; display: flex; justify-content: center; align-content: center; padding: 0; cursor: pointer; border: none; height: 110px; } .wx-card-widget#wx-card-wechat img { max-height: 110px; object-fit: cover; } /* QQG-card-shadow */ .qqg-card-widget { box-shadow: 0 8px 16px -4px #2c2d300c; background: #fff; border: 1px solid #e3e8f7; transition: 0.3s; border-radius: 12px; transition: 0.3s; position: relative; overflow: hidden; margin-top: 1rem; padding: 1rem 1.2rem; } /* QQG-fanzhuan */ #qqg-flip-wrapper { position: relative; width: 235px; height: 110px; z-index: 1; } #qqg-flip-content { width: 100%; height: 100%; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; transition: cubic-bezier(0, 0, 0, 1.29) 0.3s; } #qqg-flip-wrapper:hover #qqg-flip-content { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); } .qqg-face { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; background: url(/qqg_face.png) center center no-repeat; background-size: 100%; } .qqg-back.qqg-face { display: block; -webkit-transform: rotateY(180deg); transform: rotateY(180deg); box-sizing: border-box; background: url(/qqg_code.png) center center no-repeat; background-size: 100%; } /* QQG-background */ .qqg-card-widget#qqg-card-wechat::before { position: absolute; width: 100%; height: 100%; left: 0; top: 0; background: url(/qq_cover.png) center center no-repeat; content: ''; } .qqg-card-widget#qqg-card-wechat { background: #00aef8; display: flex; justify-content: center; align-content: center; padding: 0; cursor: pointer; border: none; height: 110px; } .qqg-card-widget#qqg-card-wechat img { max-height: 110px; object-fit: cover; }
第三步,下载附件图片素材上传到服务器,并修改css里面的url就行了,F5刷新就可以看到效果了
附件下载地址:
您需要登录并回复后才可以查看隐藏的内容
请求资源或报告无效资源,请点击[反馈中心]