How to layout using CSS position:absolute?

I was able to achieve this by putting img tag on the same line as the input. I have the img set to 25px by 25px but this strategy should work for a large image as well.

Example code:
image

Html viewer:
image

Refer to this for setting the image on java side: