I would try with SVG in the background:
div { background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 100"><rect x="-5" y="-5" width="90" height="110" fill="#fff" /><polygon fill="green" points="0,0 80,50 0,100"/></svg>'); background-position:100% 50%; background-size:auto 100%; background-repeat:no-repeat; background-color:green; }
http://jsfiddle.net/wm1am7ry/
Note. The SVG image has a white background and a green triangle. Therefore, it will not work if the background under the arrow is not a solid color.
If the width has been fixed, you can place the SVG in the generated content, located behind the green frame, which avoids the white background under the arrow:
http://jsfiddle.net/wm1am7ry/1/
div { background-color:green; padding:20px; margin:10px 0; width:100px; position:relative; } div::after { content:""; display:block; position:absolute; top:0; bottom:0; left:100%; width:100%; background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 100"><polygon fill="green" points="0,0 80,50 0,100"/></svg>'); background-position:0 50%; background-size:auto 100%; background-repeat:no-repeat; }
pawel
source share