【问题标题】:An Issue with Blogger new Notable theme: thumbnail image boxBlogger 新值得注意的主题的问题:缩略图框
【发布时间】:2017-10-11 06:00:40
【问题描述】:

在主页的缩略图框中显示帖子的图像,如下所示:

无论如何我可以让缩略图框包含帖子的图像吗? 无论图像的尺寸如何,它总是会在我发布的任何帖子中放大图片。 我对这部分的 css 玩了一点,但我无法让它包含图像。

谢谢 我的博客网址:www.aflamtalk.com

【问题讨论】:

    标签: image css thumbnails blogger


    【解决方案1】:

    您可以在span.snippet-thumbnail-img 选择器上尝试background-size: contain

    像这样:

    span.snippet-thumbnail-img {
        background-size: contain;
    }
    

    这可能是也可能不是您想要的效果。这取决于您的用例

    【讨论】:

      【解决方案2】:

      搜索以下代码块

      .post-outer .snippet-thumbnail-img {
          background-position: center;
          background-repeat: no-repeat;
          background-size: cover;
          width: 100%;
          height: 100%;
      }
      

      并将background-size: cover; 更改为background-size: contain;

      【讨论】:

        【解决方案3】:

        我在改变中找到了解决方案:

        background-image: url(<b:eval expr='resizeImage(data:post.featuredImage, 256, &quot;1:1&quot;).cssEscaped'/>);
        

        background-image: url(<b:eval expr='resizeImage(data:post.featuredImage, 256, &quot;16:9&quot;).cssEscaped'/>);
        

        &lt;b:includable id='normalPost'&gt;

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2018-10-16
          • 2019-04-10
          • 1970-01-01
          • 2011-07-04
          • 2020-01-03
          • 1970-01-01
          • 2017-07-25
          相关资源
          最近更新 更多