【问题标题】:Margin in between a PhotosetPhotoset 之间的边距
【发布时间】:2016-02-14 22:05:08
【问题描述】:

我需要一些帮助:

我希望在帖子之间和照片集的照片之间(也是 10 像素)有一个恒定的边距(10 像素)。 我的问题:如果帖子是照片集,最底部照片的边距和整个帖子的边距加起来为 20px。

我想为视频、文本等保留帖子页边距。

这是页面:

http://juliuschoenleber.tumblr.com/

顶部图像是单个图像(但也可以是例如视频)。 您可以看到以下照片集的“双边距”。

头代码:

.post{margin-bottom:10px;width:500px; font-size:{text:text     
size}px;width:500px;}

.post img{width:500px;margin-bottom:10px;}

正文代码:

{block:Photo}
<div class="post"align="center">
{block:IndexPage}
<img src="{PhotoURL-500}" alt="{PhotoAlt}" />
{/block:IndexPage}
</div>
{/block:Photo}

{block:Photoset}
<div class="post"align="center">
{block:Photos} 
<img src="{PhotoURL-500}" alt="{PhotoAlt}"/>
{/block:Photos} 
</div>
{/block:Photoset}

我尝试了不同的东西。但这只会使利润更加混乱。

感谢您的帮助。

【问题讨论】:

  • 请将您的鼠标放在您的标签上并阅读它们。一个标签不应该在这里。

标签: html css margin margins


【解决方案1】:

试试这个

.post img {
    width: 500px;
    margin-top: 10px;
}
.post img:first-child {
    margin-top: 0px;
}

【讨论】: