我有一个 iphone 模板,我有一个屏幕图像。我希望屏幕图像将自身定位在 iphone 模板内。我尝试在 CSS 中使用 position 属性,但屏幕图像会转到整个网页的顶部而不是 div。
<div class="span4" id="iphone-white">
<img class="iphone-white-img" src="img/iphone-wht-front.png" alt="" />
<div id="iphoneInside">
<img class="On imgSize" id="screen1" src="img/blue.jpg" alt="" />
</div>
</div>
CSS:
.iphone-white-img {
max-height: 720px;
max-width: 337px;
width: 100%;
margin-top: 15px;
position: relative;
}
.imgSize
{
max-height: 620px;
max-width: 287px;
width: 100%;
position: absolute;
top: 0;
}