Just helping you with this, as you tried, but it did not work as you expected ... So, the main idea is that we can use CSS pseudo-elements to create this effect.
Demo
.wrapper { background: #C3C3C3; padding: 20px; font-size: 40px; font-family: Arial; text-align: center; position: relative; } .wrapper:after { content: ""; width: 0; height: 0; border-top: 42px solid transparent; border-bottom: 42px solid transparent; border-right: 40px solid white; position: absolute; right: 0; top: 0; }
Iβm not doing anything here, we use the pseudo-element ie nothing but a virtual element that is not in the DOM, but we can insert it using CSS and positioning this pseudo-element on the right side of your wrapper. This will help you get the tape as an end. Note that the color of the triangle is hard-coded and not transparent.
source share