css - Responsive device with image overlay -


i'm looking overlay image of content on top of iphone, can scale responsively , fit/remain within screen area of device. haven't been able find tutorial on how accomplish effect. here i've tried far...

http://jsfiddle.net/mcasavant/vlbae/1/

<div class="large-5 columns"> <img src="http://www.ikonet.com/en/visuelmobile/images/iphone4.png" alt="" /> <img class="inner" src="http://old.mobilecrunch.com/wp-content/uploads/2010/01/iphone-4-os.jpg" alt="" /> 

 .large-5 {     width: 80%;     position: relative; }  img {     max-width: 100%; }  .columns:first-child {     float: left; }  .inner {     position: absolute;     top: 17%;     left: 1.3%;     padding: 0 12%;     max-width: 76%; }  .columns {     padding-left: 15px;     padding-right: 15px; } 

however scales weirdly, , kind of juts out on left little. not appealing. ideas?

may suggest placing wrapping image background of content image instead?

it might need tweaking think job.

http://jsfiddle.net/xc446/7/

<div class="wrapper">     <img src="http://old.mobilecrunch.com/wp-content/uploads/2010/01/iphone-4-os.jpg" alt="" /> </div> 

.wrapper { width:200px}  img {     background-image : url('http://www.ikonet.com/en/visuelmobile/images/iphone4.png');     background-repeat : no-repeat;     background-size : 100% 100%;     width : 100%;     height : auto;     padding : 35.5% 7% 46% 8%;     box-sizing :border-box;     -moz-box-sizing:border-box; } 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -