Tumblr photoset percentage width

允我心安 提交于 2019-12-08 08:21:08

问题


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!


回答1:


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% }



来源:https://stackoverflow.com/questions/12773598/tumblr-photoset-percentage-width

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!