6

How To Put fontawesome in placeholder. Here is my code:

<div class="form-group">         
    <input class="form-control" placeholder="username" id="inputdefault" type="text" />
    <input class="form-control" placeholder="password" id="inputdefault" type="text" />
</div>
nicolallias
  • 1,055
  • 2
  • 22
  • 51
Ephraim
  • 133
  • 7

2 Answers2

3

Try this way:

input {
  padding:10px;
 font-family: FontAwesome;
   
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<form role="form">
  <div class="form-group">
    <input type="text" class="form-control empty" id="iconified" placeholder="&#xf2ba">
  </div>
</form>
All about JS
  • 562
  • 2
  • 10
0
<input type="text" class="form-control" placeholder="&#xF002;" id="inputdefault" style="font-family:Arial, FontAwesome" />

A list of hex codes can be found in the Font Awesome cheatsheet.

Calvin Ananda
  • 1,440
  • 1
  • 14
  • 30