Creating a hole in a element

CSS box-shadow is supported in almost all modern browsers, so you can do what you want (I hope, I understood you right) this way:

body {
  margin: 0;
  padding: 0;
}

.hole {
  position: absolute;
  left: 50px;
  top: 50px;
  width: 100px;
  height: 100px;
  box-shadow: 0 0 0 99999px rgba(0, 0, 0, .8);
}
<img src="http://upload.wikimedia.org/wikipedia/commons/5/51/Fox_Head.jpg" alt="" style="width: 100%;">
<div class="hole"></div>

So, the block will be transparent, and all around it will be highlighted with its shadow.

Leave a Comment