我正在尝试使用CSS移动前景图像,使其与背景图像重叠一点。我似乎无法让前景图像移动到任何地方,我只是无法弄清楚我做错了什么。任何人都可以将我指向正确的方向吗?看我的fiddle。使用CSS移动前景图像
HTML:
<img src="http://image.tmdb.org/t/p/w1000/aUYcExsGuRaw7PLGmAmXubt1dfG.jpg" style="-webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)))"
width="auto" height="400" class="backgroundImg">
<div class="frontImg">
<img src="http://image.tmdb.org/t/p/w150/2i0JH5WqYFqki7WDhUW56Sg0obh.jpg" class="" height="300" width="auto">
</div>
CSS:
body{
background: black;
}
.background{
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
.frontImg{
position: absolute;
left:200;
top:500;
z-index: 1;
}