Trying to achieve this with css.
I've achieved in doing this but this breaks if my label (CAREER) is longer the size of the div
. If its longer then the content wraps and the height of the div
increases. But the left ribbon cut does not do that responsively. Can someone suggest a better approach?
.custom-tag-container {
border: 1px solid;
margin: auto;
display: flex;
align-items: stretch;
border-color: green green green transparent;
padding: 4px !important;
}
.custom-tag-container>p {
color: green;
font-weight: bold;
flex: 1;
margin: auto;
}
#triangle-left {
height: 25px;
width: 25px;
background: transparent;
transform: rotateZ(45deg) translateX(-12.5px) translateY(12.5px);
border: 1px solid;
border-color: green green transparent transparent;
}
<div class="custom-tag-container">
<div id="triangle-left" />
<p>Hello Worldsm</p>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…