Skip to content

Instantly share code, notes, and snippets.

@kogakure
Created August 7, 2013 09:42
Show Gist options
  • Select an option

  • Save kogakure/6172657 to your computer and use it in GitHub Desktop.

Select an option

Save kogakure/6172657 to your computer and use it in GitHub Desktop.
CSS: Mask with -webkit-mask and adding a border with second mask
<div>
<img class="cutout" src="http://jedidiah.eu/code/css/masks/images/periwinkle.jpg" alt="">
</div>
div {
background: red;
-webkit-mask-image: -webkit-radial-gradient(center ellipse cover, #000 0, #000 105px, transparent 106px, transparent 254px);
-webkit-mask-position: 88px 7px;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 254px 254px;
}
.cutout {
-webkit-mask-image: -webkit-radial-gradient(center ellipse cover, #000 0, #000 100px, transparent 102px, transparent 250px);
-webkit-mask-position: 90px 10px;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 250px 250px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment