Because when I add a font awesome icon to a text box does the icon only show me a rectangle?

1

Currently I would like to add a icono within my textfield so that the user can see something related to what the field represents.

HTML code:

<input type="text" name="nombre" placeholder="&#xf075; Add Comment" id="txtnombre_promotor" />

CSS Code:

#txtnombre_promotor {
    font-family: 'FontAwesome';
    content: "\f007";
}

I have already included in my index.php the reference to fontawesome and it is the version 4.7.0

Current result:

I think the problem may be due to the placeholder, since if I remove the .css code, the rectangle still looks in my text box and I think that it should be an alcodigo that enters the textfield.

    
asked by David 13.07.2017 в 20:48
source

1 answer

1

Apparently it works well, or is it another expected result?

#txtnombre_promotor {
    font-family: 'FontAwesome';
    content: "\f007";
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<input type="text" name="nombre" placeholder="&#xf075; Add Comment" id="txtnombre_promotor" />
    
answered by 13.07.2017 / 20:53
source