0

Hello!
I want to add some icons on my .html work. i tried to do like this, for example: <span class="icon-home"></span> (but nothing show)
Anyone can help me please?
Thanks in advance!

3
Contributors
2
Replies
15
Views
2 Years
Discussion Span
Last Post by mattster
1

the html markup, <span class="icon-home">, doesnt nothing on its own to produce an icon (image). You would need to apply a style to the span.icon-home selector.

For example...here is one way to display an image for the span element with a class of "icon-home"

span.icon-home { 
  background: url(/images/home.png) no-repeat; 
  background-size: 16px 16px;
  width: 16px;
  height: 16px;
  display:block;
}
Votes + Comments
thanks!
1

Dont forget to take a look at the font awesome library!

To use it, shove this in your <head> section:

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

Then do this wherever you want to use an icon:

<!-- Instead of this -->
<span class="icon-home"></span>

<!-- Use this -->
<i class='fa fa-home'></i>

Then you can chage the colour of the icon so its the same as your text etc., loads of tutorials online and great to play around with. See here.

Votes + Comments
THANK U SO MUCH!
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.