gpt4 book ai didi

html - 如何从社交媒体缩略图中排除 Jumbotron 图像?

转载 作者:数据小太阳 更新时间:2023-10-29 07:26:41 24 4
gpt4 key购买 nike

每当我的博文被分享时,缩略图会自动优先显示超大屏幕图片,而不是默认为博文图片:

enter image description here

enter image description here

查看

<%= 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com