我正在直接指向这里。 我想在图像中创建一个简单的窗口。窗口外部的 将具有不透明度,就像样本图片上的不透明度。在图像上添加不透明度
对于css,我不太好,所以请耐心等待。
.section2{
}
.section2 .row{
margin: 0;
}
.the-container{
position: relative;
width: 100%;
height: 450px;
}
.the-container .text-center{
background: #fff;
opacity: .9;
}
.img-canvas{
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
background-image: url(https://www.aman.com/sites/default/files/styles/1371x706/public/amanpulo-location-1200-x-825.jpg?itok=4BQy9j-X);
background-size: 100% 100%;
background-position: 50% 50%;
background-attachment: scroll;
z-index: -1;
}
.window{
position:absolute;
width:50%;
height:50%;
background-size: cover;
top:0;
left:25%;
z-index: -1;
opacity: 1;
}
<section class="section2" style="height:100vh;">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="the-container">
<div class="img-canvas"></div>
<div class="window"></div>
</div>
</div>
</div>
</section>
,这里是一个捣鼓您操作的代码: https://jsfiddle.net/Lk21vL01/
在此先感谢。
开平!!它违反了这个计算器规则吗?!你应该自己做。不要问问题让别人完成整件事情。 –
@sherlyfebrianti,OP已经发布了他们的尝试,我wouldnt考虑这个要求人们做本身的整个事情 – haxxxton
@sherlyfebrianti对不起。我尝试了一些东西,但没有放置所有东西..我有一个标题,但这需要不透明度..但是我无法真正弄清楚如何制作图像的两面。 –