To start, enclose both the image and arrow within a <div>
element like this:
<div class="wrapper">
<img src="http://lorempixel.com/250/200" alt="">
<div class="cssarrow"></div>
</div>
Next, utilize absolute positioning to place the arrow in the top-right corner of the wrapper div:
VIEW EXAMPLE HERE
.wrapper {
position: relative; /* Create a reference point for absolute positioning */
display: inline-block; /* Adjust width based on content */
}
.wrapper img {
vertical-align: middle; /* Eliminate gap below inline-level element */
}
.cssarrow {
width: 0;
height: 0;
border-style: solid;
border-width: 0 20px 20px 0;
border-color: transparent gold transparent transparent;
position: absolute; /* Remove from normal flow */
top: 0; right: 0; /* Position at top-right corner of the wrapper */
}