Insert icon in input text with HTML and CSS

0

Hello, I would like to insert an icon in the input text of my system, until I could put the icon, but when I click on the input to type the text the icon simply does not hide. can you help me?

    
asked by anonymous 24.04.2017 / 20:02

2 answers

3

When you focus on your text field:

You use pseudo class :focus to remove background-image from your input

Declare in your css:

input[type='text']:focus { 
    background-image: none; 
}
    
24.04.2017 / 20:10
0

Something like:

<i class="icon ion-search placeholder-icon"></i>
<input type="text" size="100" ng-model="q" placeholder="Procurar" onclose="fechaTeclado();" />

Where <i> you put the icon you want.

    
24.04.2017 / 20:09