I have a div which needs to display an arrow from one of 4 directions (top, left, right, bottom) during a merge event. The div can be any size and the arrow should scale to about 30% of the div size.
I am not sure how to make the arrow in this jsfiddle scale to the size of the .box div without using JavaScript to set the size of the border-width triangle (hover over the box to see what I mean). Maybe you guys know a better way to draw the arrow.
this is hiding the problem in fact, but may be sometime can be usefull:
(i used
zoomto change size of the container)demo
also here is arrow with svg data, but this can’t be used when you expect to change the aspect ratio of arrow.
as border-width can’t be percentage there is no real way to get the goal