我有一個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;
}
yes,那樣做了,我還有一個問題,我可以用什麼CSS來完美地放置屏幕圖像模板? – user2441391
我會使用'top:'和'left:'CSS屬性來調整屏幕圖像,直到它定位在你想要的位置。像'.imgSize {top:20px; left:10px; }'。 – user1171848
非常感謝好友 – user2441391