Please see the image below.
I want to add an arrow to the top right of a div
which I am treating as editable input box.
Please help me how I can achieve this using CSS.
I cannot use a SVG since I need this as a div
to show emoticons as images over it.
<div placeholder="Your message" id="Message">
...
</div>
You can do it like in the below snippet. The method used to achieve the shape is as given below:
div
element only has a top, bottom and left border. The right border is nullified because the element and its arrows needs to be transparent. With a transparent arrow, if a right border is present that would also get displayed.skew
ed element placed with respect to the right edge of the shape.You can adjust the height and border-radius as required. I have set the positioning such that even a change in height/width of parent would not affect it.
The arrow can be added to the left side by changing the positioning attributes and the skew direction (from positive angle to negative angle) like in the below snippet.
Filter: drop-shadow()
The compatibility is limited
Yet the effect is pretty cool :P
Box-shadow:
Here the compatibility is a lot better