Looking to add a dynamic badge in the top left corner of a div that adjusts its size based on the text content.
Check out this example: http://jsfiddle.net/sbick/npxaasht/
<article>
<div class="triangle">
<span>NEW</span>
</div>
<p>lorem ipsum</p>
</article>
<article>
<div class="triangle">
<span>BACK ORDERED</span>
</div>
<p>lorem ipsum</p>
</article>
These two elements have varying amounts of text. "NEW" fits perfectly due to hardcoded values, while "BACK ORDERED" spills over the triangle shape.
I'm seeking a solution where the triangle dynamically adjusts its size to accommodate different text lengths.
Is it achievable using CSS?