For a portfolio, I need to wrap all images with a computer image for presentation. I'm going to use something like this example to wrap images:
Images must have fluid dimensions (height & width in percent), so the wrapper too..
Anyone has an idea about how to achieve that?
Is there a way to do it cross-browser way?
If i were you i would follow this way :
1) create laptop monitor-like div - Its just a div with thick black border + top left and top right rounded borders + 2 elements (green point and reflection) you can create it with CSS or use images.
2) create bottom part of laptop - Its also rounded div + shadow + cavity
Add the image as a
background-image
of a reziseable<div>
and append a second div with another backgrund image.like:
Update: I did not think about the inner spaceing on rezising. You should try to estimate the distance between content and outer in percentage.
Update:
The best thing you can do, is to add the background-image as
<img>
in the document. Not as a background-grafik. This will be your canvas to place a inner div:CSS
Working fiddle: http://jsfiddle.net/Kq7ym/3/