I have applied an svg as mask-image to certain divs. After doing that their border is gone.
.icon {
padding:5px;
border:5px solid #000;
width: 150px;
height: 150px;
display: inline-block;
-webkit-mask: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg) no-repeat 50% 50%;
-webkit-mask-size: contain;
mask-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg) no-repeat 50% 50%;
mask-size: contain;
}
.red {
background-color: red;
}
.blue {
background-color: blue;
}
<div class="wrap">
<div class="icon red"></div>
<div class="icon blue"></div>
</div>
Any idea why this happens? Any solution should be based solely on css.
I am using an extra div wrapper to create border around the div containing mask.
I have added comments to the code to explain my changes.