1. If you want to keep the width of the icon as is, even on smaller screens.
You can use transform:translate(-50%,-100%) and then adjust the percentage of left and top to place the icon.
Fiddle: https://jsfiddle.net/mfgdp3j3/14/
2. If you want the icon to change depending on the screen size.
Additionally, you can set min-width and max-width if you feel that the size of the icon is too large / small when resizing.
Fiddle: https://jsfiddle.net/0yozs4tr/
3. If you want the icon to change with the image
Set the width of the icon as a percentage (approximately 24%). In this case, the icon may look too small with smaller screen sizes.
Fiddle: https://jsfiddle.net/mfgdp3j3/18/
source share