每当我的博文被分享时,缩略图会自动优先显示超大屏幕图片,而不是默认为博文图片:
查看
<%= image_tag "galli-walking.jpg", alt: "Conquering life and goal challenges so we can get the most out of life.", class: "main-image" %>
<div class="blog-text">
<div class="blog-paragraph">
A DAILY BLOG ABOUT MY<br>
JOURNEY & LIFESTYLE
</div>
<%= render 'subscribes/subscribe.html.erb' %>
</div>
<%= link_to @post.title, blog_path(@post) %>
<%= simple_format(@post.body, {}, {:sanitize => false}) %>
最佳答案
尝试将此标记添加到 <head></head>
<meta property="og:image" content="<%= image_path('your_image') %>" />
排除图像被共享使用的可能解决方案是使用具有 CSS background-image 属性的 div。相反
<%= image_tag "galli-walking.jpg", alt: "Conquering life and goal challenges so we can get the most out of life.", class: "main-image" %>
使用
<div style="background-image: url('galli-walking.jpg'); width:Xpx; height:Xpx;></div>
关于html - 如何从社交媒体缩略图中排除 Jumbotron 图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38383950/