0

I am stuck working with font awesome 6 icons while using it's icon in placeholder. Here is the code snippet:

<input id="search-box" type="text" class="form-control" **placeholder="&#xf246 Something"** aria-label="Recipient's username"             aria-describedby="basic-addon2" autofocus data-bs-toggle="tooltip" data-bs-placement="bottom" title="Enter Player Name">

CSS and try to implement a feature

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • What do you mean you are "stuck"? Also "CSS and try to implement a feature" is not a complete sentence, so I'm not sure what it is supposed to be saying. – TylerH Mar 22 '22 at 15:24
  • Possible answer here? [enter link description here](https://stackoverflow.com/questions/19350291/use-font-awesome-icon-in-placeholder#:~:text=Use%20placeholder%3D%22%EF%80%82,FontAwesome%3B%22%20in%20your%20input) – Marios Mar 22 '22 at 15:28

1 Answers1

2

Just add fa or fas class to input.

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css" rel="stylesheet">

<input class='fa' placeholder="&#xf246">
zer00ne
  • 41,936
  • 6
  • 41
  • 68