问题
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