2014-02-22 30 views
0

所以我從tympanus得到這個Fullscreen Background Image Slideshow :)你可以肯定地看到上面鏈接的網站上的代碼...現在我不希望它整個頁面...我想添加利潤全...我一直在努力去做,但無濟於事。我嘗試將背景圖像的大小縮小爲較小的百分比,但它仍然不成比例...製作背景幻燈片不是全屏?

如何在幻燈片中添加相同的填充? :(

.cb-slideshow li span { 
width: 100%; 
height: 100%; 
position: absolute; 
top: 0px; 
left: 0px; 
color: transparent; 
background-size: cover; 
background-position: 50% 50%; 
background-repeat: none; 
opacity: 0; 
z-index: 0; 
animation: imageAnimation 36s linear infinite 0s; 
} 
+0

一種方式是通過改變寬/高爲'鈣(100% - 50像素)'其中'50px'是你想要的邊距的兩倍,然後使用'margin-left:25px; margin-top:25px',使用你想要的邊距值。另一個選擇是將它放在一個容器中,位置爲:相對;'和大小/定位容器的方式,你想 –

回答

0

我認爲絕對簡單的方法是這樣做:你可以做

.cb-slideshow li span { 
left: 5%;     // alter as you like 
top: 5%;     // alter as you like 
width: 90%;     // alter as you like 
height: 90%;    // alter as you like 
position: absolute; 
color: transparent; 
background-size: cover; 
background-position: 50% 50%; 
background-repeat: none; 
opacity: 0; 
z-index: 0; 
animation: imageAnimation 36s linear infinite 0s; 
}