I am trying to create a parallelogram kind of box aligned in a row and text inside it. But the styles I tried are not producing the exact designs that I want to achieve.
Whenever I try to increase the width of the content div, that's increasing the space between those items. Below is the code I tried and got this.
body {
background: grey;
}
.col {
display: flex;
position: relative;
}
.y-axis-label {
transform: rotate(35deg);
white-space: nowrap;
position: relative;
display: flex;
font-size: 11px;
border-radius: 4px;
padding: 4px;
width: 35px;
justify-content: flex-end;
right: 0px;
top: 18px;
}
.y-axis-label-text {
background: white;
padding: 0px 4px;
border-radius: 4px;
height: fit-content;
clip-path: polygon(0 0, 100% 0%, 83% 100%, 0% 100%);
}
<div>
<div class="col">
<div class="y-axis-label">
<span class="y-axis-label-text">Development</span>
</div>
<div class="y-axis-label">
<span class="y-axis-label-text">Testing</span>
</div>
<div class="y-axis-label">
<span class="y-axis-label-text">Management</span>
</div>
<div class="y-axis-label">
<span class="y-axis-label-text">Marketing</span>
</div>
<div class="y-axis-label">
<span class="y-axis-label-text">QA</span>
</div>
</div>
</div>
I tried using transform: skew and that's changing the text inside of it. Can someone help me on achieving this?
