Html – Position icon at the top right corner of a div

csshtml

I created this code, but I don't able to put the icon on the right corner of div with class valori.

Here the desired result :

enter image description here

Here the code :

HTML

<div class="circletop">
<div class="numberpr">3° anno</div>
<div class="lordo">Valore lordo stimato</div>
<!--I add div icon here-->
<div class="icon"></div>
<div class="valori"> <?=$min3_anno ." - " . $max3_anno?></div>
</div>

Here my fiddle : https://jsfiddle.net/5g42Lx7n/
I need to add the icon in the top right corner like image.

thanks

Best Answer

Check https://jsfiddle.net/bgo2e5zk/4/

.icon{position:absolute;right:0;top:-15px}
.valori{position:relative;}


I put the icon inside .valori, then add position:relative to .valori and position:absolute to .icon, and to finish, set top and left to the icon to positioning it.