You have two options.
- Place the image as input background, but it will not be available.
- Absolutely position the element above the input.
1
.myInput { background:url(path/to/img.jpg) 5px 5px no-repeat; }
2:
HTML
<div class="inputContainer"> <input class="myInput" type="text" name="myInput" id="myInput" /> <a href="#" class="inputImg"><img src="#" /></a> </div>
CSS
.inputContainer { position:relative; } .myInput { padding-left:25px; } .inputImg { left:5px; position:absolute; top:5px; z-index:5; }
You will need to play with the position and values depending on the input size, image size and overall placement, but this should do what you want.
source share