Tumblr图片百分比宽度 [英] Tumblr photoset percentage width

查看:143
本文介绍了Tumblr图片百分比宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了4个Tumblr主题。无论窗口大小如何,每个列的宽度都是25%,并且使用{PhotoURL-500}图像收缩或展开OK,问题伴随着photosets,它们是静态的并使列崩溃。由于我没有使用像素,但有百分比,有一种方法可以使照片适合在%列中显示。
Thanks!

解决方案

使用以下代码将主题HTML中的当前photoset块替换为:

  {block:Photoset} 
< div class =photoset content>
{block:Photos}
{block:Photo1} {/ block:Photo1}
< div class =photoset_div>
< img src ={PhotoURL-500}class =photo_img/>
< / div>
{/ block:Photos}
{block:Caption}
< div class =caption> {Caption}< / div>
{/ block:Caption}
< / div>
{/ block:Photoset}

在你的样式表中,使你的.photoset_div img {宽度:100%}


I'm creating a 4 colum Tumblr theme. Each column width is 25% and using {PhotoURL-500} images shrink or expand OK regardless of the window size, the problem comes with photosets, they are static and make the columns collapse. Since I'm not working with pixels but with percentage there's a way of making photosets fit in % columns? Thanks!

解决方案

Replace your current photoset block in your theme’s HTML with this:

{block:Photoset}
<div class="photoset content">
    {block:Photos}
    {block:Photo1}{/block:Photo1} 
        <div class="photoset_div">
            <img src="{PhotoURL-500}" class="photo_img" />
        </div>                      
    {/block:Photos}
    {block:Caption}
    <div class="caption">{Caption}</div>
    {/block:Caption}
</div>
{/block:Photoset}

In your stylesheet, just make your .photoset_div img { width: 100% }

这篇关于Tumblr图片百分比宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆