Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how do you add a search icon, inside of a placeholder?

I am just wanting to add a font awesome icon inside a placeholder. i have tried using the Unicode inside the placeholder but that doesn’t work. i have also tried using pseudo elements but still does not work.

<input type="text"  name="search bar"  placeholder="search">

input{
width: 4%;
position: absolute;
right: 188px;
top: 24px;
background-colour: #000000;
}

::placeholder{
    colour: antique white;
}    

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css" rel="stylesheet"/>
<input style="font-family: FontAwesome;" placeholder='&#xf002 search' />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading