I did this once, I'm not sure everyone will agree with my implementation, but at the time, this worked for me:
Create a div in the right place, set the height and width (for the window effect); put the div in the right place and then just add the schema to it.
body { background-image: url(http://lorempixel.com/800/800/nature/5/); background-size: cover; } .windowDiv { position: absolute; top: 100px; left: 100px; height: 300px; width: 300px; outline: 4000px solid rgba(0, 0, 0, 0.5); }
<div class="windowDiv"></div>
EDIT: use background color, not transparency.
2nd EDIT: as A. Wolf said, you should use the contour instead of the border for more convenient positioning.
source share