我想要這個:http://gyazo.com/0fe69e349ed5cd4e72a08ed8e60af5d4
但我無法實現它。我可以不是更改圖像。 我已經使用了一個圖像作爲面具,但是這給了我這個:http://gyazo.com/b69e840d095212bce422252cec081fe9
有沒有辦法讓側面部件是白色的?'圖層'在HTML,透明部分
我的代碼:
#section1{
height:275px;
width:100%;
background-image: url('/img/paral1.jpg');
background-position: center top;
background-repeat:no-repeat;
background-size: 100% 916px;
}
.overlay{
position: absolute;
margin-top:180px;
height:100px;
width:100%;
overflow: hidden;
}
.mask{
margin: 0 auto;
background-image: url('/img/section1.png');
height:100px;
width:1080px;
background-size:100% 100%;
}
編輯:的jsfiddle:http://jsfiddle.net/31kxqmLt/
的jsfiddle在全屏:http://jsfiddle.net/31kxqmLt/embedded/result/
編輯編輯:面具必須有1080px的寬度和空間的其餘部分應該是白色的。
提供您的HTML以及 – Danield 2014-10-06 10:45:58
或撥弄會好 – 2014-10-06 10:46:50
東西[就像這個例子](http://jsbin.com/felah/1/edit)?在較小的寬度上有一個錯覺,它看起來偏離中心,但它不是! – misterManSam 2014-10-06 10:55:45