Fontawesome icons inside a palaceholder

This is one way to use fontawesome icons inside a palaceholder:

in the CSS you have to use this code for the class fontAwesome:

After that in the HTML you have to add the **fontawesome class** first and then the **fontawesome icon code** inside the placeholder:

and it’s done!!!

You can simply apply the class every time inside your input with the relative code in the placeholder.

And even more, you can use this method by entering the code into a generic element such as a link or a simple text using the same class “fontAwesome” used for the placeholder:

You can see the result or read the post from my codePen post.

See the Pen FontAwesome and placeholders by Massimiliano Ranauro (@huckbit) on CodePen.

CSS: vertical-align property

You need to add the line-height attribute and that attribute must match the height of the div to center text in a div box.

This code is useful to centre text inside the box vertically and horizontally.

Centered text in a box!

Great Article about centering in css

css: using the @font-face directive

The secret to web fonts is a CSS command called the @font-face directive.

This command at its most basic names the font and tells the browser where to find the
font file for download.

You place the @font-face directive in your style sheet, just like a regular style.

For example, say you’re using the League Gothic font. You have a True Type file named League_Gothic-webfont.ttf inside a fonts folder on your site.

You’d instruct a browser to download this font by adding the @font-face directive to your style sheet like this:

The first property, font-family, you’ve seen before (page 127), but here it has a different purpose. When used inside an @font-face directive, font-family assigns a
name to the font.

When used inside an @font-face directive, font-family assigns a
name to the font.

For example, say you want to use the League Gothic font for all paragraphs
on a page. You could then use this style: