-1

I have huge problem in achieving effect of inverted borders like on the photo. I know how it could be looking if it would be a non transparent background, but can't figure it out when it's fully transparent. Do you have any ideas? Thank you for help.

Here is my code example for non transparent background:

.box {
 width: 100px;
 height: 120px;
 margin: 0 auto;
 position: relative;
 background-image: radial-gradient(   transparent 0px,    transparent 10px,    orangered 10px,   orangered  );
 background-size: 20px 20px;
 background-position: -10px -10px;
 &:before, &:after {
   content: '';
   display: block;
   position: absolute;
   background-color: orangered;
 }
 &:before {
   top: 0;
   right: 10px;
   bottom: 0;
   left: 10px;
 }
 &:after {
   top: 10px;
   right: 0;
   bottom: 10px;
   left: 0;
 }
}


.inner-round {
  height: 100px;
  width: 100px;
  background: orangered;
}
<div class="box">
  
</div>

Example photo

1 Answers1

1

Try to apply this property:

border-radius: 100%;

And visit this link for more clarification:

https://codepen.io/sergejmueller/pen/fJEml

Andrew Myers
  • 2,754
  • 5
  • 32
  • 40
Mohit_
  • 49
  • 1
  • 7