I need to add a Fontawesome icon to an input field, using the ::before
pseudo element. However, the icon is not showing and I can't figure out what I'm doing wrong. (I'm using Bootstrap and Fontawesome 5 Pro).
.search-field-round::before {
content: '\f002';
font-family: 'Font Awesome 5 Pro';
font-weight: 900;
display: inline-block;
position: absolute;
top: 0;
left: -5px;
color: red;
}
<!-- Bootstrap CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<!-- FONT AWESOME CDN - Since I'm using a Pro version I do not wish to share my link here -->
<form class=" form-inline searchbar-form col-12 ">
<div class="col-10 search-field ">
<input type="search " class="form-control search-field-round " placeholder="¿Qué servicio buscas? ">
</div>
</form>