+7

How to use icons in HTML code?

How to use icons in code from existing sources in HTML?

8/2/2019 11:58:16 AM

Spl

11 Answers

New Answer

+17

As said talking about "existing source" you can use all available but If you're talking about the data you've already there, Then use it by resizing in "PX" .

+5

Now I got it, how to use icons from font-awesome, I used in my login form code, anybody can check it.. https://code.sololearn.com/Wipknmkomh1o/?ref=app

+4

Icons are added via css you make a sprite, add through a pseudo-class and place it.

+4

No, Thống Nguyễn in my html code I want to use icons from font-awesome, I tried but it's not working.. So I want to know how to use from there or any other sources

+4

Thanks Thống Nguyễn

+4

Shikha it's imported in css

+2

Spl post the code in which you are trying to use fontawesome icons

+1

Oh, that is simple. First, you need to know wich version you want to use (the icon class name is different on other versions). Then embed the right version on your html code (there are several way to do that) you can search for awesome font install and read the instruction. For now i prefer you to try my favorite version by adding this code inside your head section of your code: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> this is version 4.7, then just find the class name of the icon you want, and insert this code in where you want to use in your code: <i class="fa fa-car"></i> ("fa fa-car" is the class name of the icon).

+1

CDN not included in head part

0

I don't actually understand your mind. You want to use icons witch you like from other HTLM in your code. Am i right?

0

By the way, this is the best awesome font i found, just take a look: https://www.w3schools.com/icons/fontawesome_icons_intro.asp