+ 1
I need your help.
Good day. I drew something like a triangle from the css border, and I want to circle this triangle with a black line 2 pixels along the outer edge. How can I do it? https://code.sololearn.com/W2NjzjKBGQkC/?ref=app
5 ответов
+ 2
you can male child inner triangle lile
.triangle-left { width: 0; height: 0; border-top: 23px solid transparent; border-bottom: 23px solid transparent; border-right: 23px solid red; } .inner-triangle { position: relative; top: -20px; left: 2px; width: 0; height: 0; border-top: 20px solid transparent; border-bottom: 20px solid transparent; border-right: 20px solid blue; }
<div class="triangle-left"> <div class="inner-triangle"></div> </div>
+ 2
Use pseudo-element to achieve it.
Check out the code
https://code.sololearn.com/W103S0E6Nvls/?ref=app
+ 1
Thanks for answers. I checked your answers, and they all work. And it helped me. But I had another question. Which of these solutions is effective for use in a group operation? I want the elements created once to move and transform easily, but not without destroying its internal structure.
+ 1
Алмат Айтбаев just try out with some transforms, i think my code should work with any css transform.
+ 1
OK. I understood you