我試圖在我的網站上的圖庫中的圖像之間添加10px的間距。我正在使用一個集成的'頁面生成器'的Wordpress自定義主題,它正在用於創建我的投資組合帖子與短代碼(不知道這是否有用的信息!)CSS:如何在圖像之間添加10px?
目前圖像是在網格佈局與零間距 - 見下圖。
我想在每張圖片之間添加一個10像素的間距,但不是在外側,因爲頁面是完整的寬度 - 請參閱下面的圖片,瞭解我希望它的外觀。
是否有人能夠幫助我修改CSS來實現這一目標?我一直在努力幾天,但它超出了我非常基本的CSS能力。
任何幫助將超級讚賞!
這裏是有問題的CSS代碼:
/* \t Gallery
------------------------------------------------*/
.sr-gallery {
\t margin: 0;
\t padding: 0;
\t list-style: none;
\t width: 100%;
\t overflow: hidden;
}
.sr-gallery.gallery-col3 { width: 100.5%; }
\t
.sr-gallery li {
\t margin: 0;
\t padding: 0;
\t float: left;
\t width: 33.33%;
\t overflow: hidden;
\t text-align: center;
}
\t
.gallery-col1 li { width: 100%; }
.gallery-col2 li { width: 50%; }
.gallery-col3 li { width: 33.33%; }
.gallery-col4 li { width: 25%; }
.gallery-col5 li { width: 20%; }
.gallery-col6 li { width: 16.66%; }
\t
.sr-gallery li a {
\t display: inline-block;
\t max-width: 100%;
}
<ul class="sr-gallery gallery-col1">
<li><img src="http://chatsingh.com/wp-content/uploads/2016/08/Secret7-003-1.jpg" alt=""></li>
</ul>
<ul class="sr-gallery gallery-col2">
<li style="
border-right: 5px solid #fff;
"><img src="http://chatsingh.com/wp-content/uploads/2016/11/Secret7-007-1100x800.jpg" alt=""></li>
<li><img src="http://chatsingh.com/wp-content/uploads/2016/08/Secret7-001-1-1100x800.jpg" alt="" style="
box-shadow: inset 10px 0 0 0 #fff;
"></li>
</ul>
<ul class="sr-gallery gallery-col1">
<li><img src="http://chatsingh.com/wp-content/uploads/2016/08/Secret7-004-1.jpg" alt=""></li>
</ul>
不發佈簡碼,上傳HTML輸出。 – Sysix