WordPress 投资组合库中图像之间的间距



我正在尝试微调我的网站,但我无法弄清楚如何增加我的任何投资组合画廊内图像之间的空间(示例)。

我已经浏览了样式.css文件,但我一定错过了一些东西。垂直间距看起来不错,但没有水平间距,图像似乎粘在一起。

我正在使用带有"Folio White"主题的wordpress。

只需将此类添加到任何 css 文件中: 并在页眉或页脚中添加该 css 以获得最佳结果

.gallery-item {
    margin-top: 0;
    margin-left: 10px;
}

谢谢

您可以按照主题的样式创建新类.css

#portfolio-wrap .col{margin-top: 1%;}

如果您使用右键单击和检查元素,这很容易,您只需将其添加到您的样式中.css:

.gallery-item {
    margin-top: 0;
    margin-left: 10px;
}

确保您的样式在插件中使用的样式之前加载。

对于垂直边距,您可以添加一个类以通过以下之一匹配所需的边距:

.only-top {margin-top:5px}
.only-bottom {margin-bottom:5px}
.top-and-bottom {margin-top:5px; margin-bottom:5px}
.overall {margin:5px}
.top-and-bottom-autosides {margin:5px auto}
.specific {margin:5px 4px 5px 4px} //note the order is: top right bottom left

您可以使用 bootsrtap 方法,例如在行和容器中。这种方法更好,因为它拉伸了容器的画廊宽度。

.gallery {
  margin: -15px;
}
.gallery-item {
  padding: 15px;
}

最新更新