Javascript,Nodejs,MongodDB,WordPress,CSS,PHP

LightBlog

Wednesday, August 29, 2018

How to add fontawesome icon in placeholder

In this post we will see how to add font awesome in input placeholder,The only way to font awesome icon in placeholder is hex code of icon and then After you add the hex code to placeholder you need to add Font Awesome to the font-family for the specified CSS class (form-control in this example).

 
 <html>
<head>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<style>
    .form-control {
  font-family: "FontAwesome"
}
</style> </head>
 <body>
 <input type="text" class="form-control" placeholder="&#xF002;">

 </html>
</body>




No comments:

Post a Comment