【发布时间】:2014-11-16 11:02:00
【问题描述】:
我正在尝试制作一个带有滚动图像的 iphone 叠加层,以展示移动网站设计,但图像没有滚动,上面覆盖的 iphone 是我做错了什么,我该如何解决?
演示:http://jsfiddle.net/jonathanl5660/Lao36z20/
<div>
<img src="https://dl.dropboxusercontent.com/u/9833562/iphone.png" width="370px" height="800px" style="position: absolute; ">
</div>
<div style="width:300px;height:700px;overflow:scroll;margin:30px; position: relitive;">
<img src="https://dl.dropboxusercontent.com/u/9833562/mtest.png" width="98%" height="700px" alt="" style="margin-top:150px;margin-left:10px;" /><br />
<br />
</div>
【问题讨论】:
-
我正在尝试编辑您的示例,但是像 jsfiddle 这样的接缝在我的机器上无法正常工作...无论如何,iphone 应该有一个相对位置和一个 z-index:-1 (以便上面的图像完全可用)并且上面的图像应该具有与父级(iphone)相关的绝对位置和合理的边距
标签: html css iphone image overlay