DEV Community

Nagarajan R
Nagarajan R

Posted on

Answer: Put icon inside input element in a form (not as background image!) [closed]

A solution without background-images:

JSFiddle.

#input_container { 
    position:relative;
    padding:0;
    margin:0;
}
#input { 
    height:20px;
    margin:0;
    padding-left:30px;
}
#input_img {
    position:absolute;
    bottom:8px;
    left:10px;
    width:10px;
    height:10px;
}
<div id="input_container">
    <input type="text" id="input" value>
    <img src="https://cdn1.iconfinder.com/data/icons/CornerStone/PNG/arrow%20right.png" id="input_img">
</div>

Top comments (0)