简体   繁体   English

如何在背景为动态的图像中使0附近的边框变为现实,并且我需要气泡的切割部分透明

[英]How can i make this border around 0 shown in the image where background is dynamic and I need the cutting part of bubble to be transparent

 .square { border: 2px solid #000; border-radius: 5px; color: #000; display: inline-block; font-weight: 600; padding: 0 6px; position: relative; } .square:before { border-left: 10px solid transparent; border-right: 0 solid transparent; border-top: 10px solid #000; bottom: -10px; content: ''; display: block; height: 0; position: absolute; transition: all 0.25s linear 0s; right: 0; width: 0; } 
 <div class="square"> 0 </div> 

在此处输入图片说明

In the shown image i want to achieve the border around the zero using css only. 在所示的图像中,我只想使用css来实现零附近的边界。 I tried this but i want hollow arrow so help me out. 我尝试了这个,但是我想要空心箭头,所以请帮帮我。
I tried speech bubble but in my case background is dynamic and I need the the cutting part of bubble to be transparent 我尝试了语音泡沫,但在我的情况下背景是动态的,因此我需要泡沫的切割部分透明

Try This: 尝试这个:

 .parent { display: inline-block; background-color: #339FFF; padding: 15px; } .child { background-color: transparent; width: 30px; height: 30px; position: relative; border:3px solid #FFF; text-align: center; color: #FFF; line-height: 30px; } .child:before{ content: ''; border-top: 5px solid #339FFF; border-left: 5px solid #FFF; width: 0; height: 0; position: absolute; bottom: -5px; right: 0px; z-index: 1; } .child:after { content: ''; border-top: 10px solid #fff; border-left: 10px solid #339FFF; width: 0; height: 0; position: absolute; bottom: -13px; right: -3px; } 
 <div class="parent"> <div class="mask"> <div class="child">0</div> </div> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM