Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

John Crillo
John Crillo
8,293 Points

Importing an icon

I can't seem to be able to import icons into my webpage. Can anyone help me do this please.

@font-face { font-family: 'icomoon'; src:url('../fonts/icomoon.eot'); src:url('../fonts/icomoon.eot?#iefix') format('embedded-opentype'), url('../fonts/icomoon.woff') format ('woff'), url('../fonts/icomoon.ttf') format ('truetype'), url('../fonts/icomoon.svg#icomoon') format ('svg'); font-weight: normal; font-style: normal;

}

I just downloaded the icons from icomoon and i can't seem to get extract them. Not sure if there are certain files I should or shouldn't be using like .svg opposed to EPS, PNG, PDF.

I also go to get info when i left click and i get:

Where: /Users/JDM Account/Downloads?Icomoon--limited--master/Icons/EPS

the name and extension is home.eps

What is the script i type to import! Please help and thank you

4 Answers

Ryan Boone
Ryan Boone
26,518 Points

The Icomoon site gives you the choice between using their app to create an icon font or downloading an icon pack. The icon packs are vector files that haven't been formatted as fonts. You can still use the vector files as icons (SVG is a great format, maybe even superior to icon fonts), but you will need actual font files (.eot, .woff & .ttf) in order to use @font-face. Hope that helps.

Ryan Boone
Ryan Boone
26,518 Points

Sounds like you downloaded the vector pack instead of the font pack. Make sure you're in the icon fonts section of the app.

John Crillo
John Crillo
8,293 Points

what do you mean by the icon fonts section... PNG's? I downloaded the free version which i thought had both vector and font options

John Crillo
John Crillo
8,293 Points

i even downloaded the project files for what I'm working on and tried to load the index.html and it also didn't have the icons