I am attempting to create a specific shape using clip-path: polygon
, but I am struggling to understand the documentation. The properties for this shape are unclear to me - what do the values represent in
clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
? The documentation doesn't provide clear explanations.
After trying some code from another source, I have achieved a design with a slanted effect:
.inner-container-top {
width: 130px;
font-size: 12px;
font-weight: 600px;
background: #8b000a;
color: #ffffff;
padding: 7px;
clip-path: polygon(0% 100%, 100% 100%, calc(100% - 30px) 0%, 0% 0%, calc(100% - 30px) 0%, 0% 0%);
}
<div class="inner-container-top">HELLOWORLD</div>
However, I still don't understand why it is creating this effect. I need assistance in flipping the shape to slant in the opposite direction and adding a slant on the left side as well. Any help would be greatly appreciated.