【发布时间】:2014-10-06 10:28:58
【问题描述】:
我想要这个:http://gyazo.com/0fe69e349ed5cd4e72a08ed8e60af5d4
但我无法实现它。
我可以不更改图片。
我使用图像作为蒙版,但这给了我这个:http://gyazo.com/b69e840d095212bce422252cec081fe9
有没有办法让侧面也变白?
我的代码:
#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/
编辑编辑:蒙版的宽度必须为 1080 像素,其余空间应为白色。
【问题讨论】:
-
同时提供您的 html
-
或者小提琴会很好
-
某事like this example ?宽度较小时会产生视错觉,看起来偏离中心,但事实并非如此!
-
misterManSam,中间部分应该是1080px,左右白色部分应该填满页面的其余部分,
标签: html css layer css-shapes