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 trialElena Paraschiv
9,938 Pointsicon from ico moon doesn't display properly
3 Answers
Luke Pettway
16,593 PointsAre you using the icon font and is it being loaded in before you are loading your stylesheet?
Elena Paraschiv
9,938 PointsThanks for you help Luke. But that does not seem to work. Do you know if I should download soemthing on my local computer? By now I just used the code that they displayed on the website
Luke Pettway
16,593 PointsAt the bottom of the screen where you select your icons, it looks like you can also output the Font or an SVG
https://icomoon.io/app/#/select/font
I tested it and it seems to work well. There is also an SVG option you can use alternatively. Both methods will give you a demo.html that should work.
Elena Paraschiv
9,938 PointsI miss something.
<div class="wrap">
<h1 id="title" class="title"><span class="icon-star-empty"></span>CSS Preprocessors</h1>
<p class="author">By: Guil Hernandez</p>
<p class="intro">
<span class="icon-spades">You've </span>probably already heard of <a href="#">CSS preprocessors</a> by now, but haven't quite plucked up the courage to try one because of the learning curve, or maybe because “preprocessor” just plain sounds intimidating. So let's put those uncertainties at ease and go over what preprocessors are, how they work, and which one you might choose. In this article, we'll discuss the 3 most popular ones: <a href="#">Sass</a>, <a href="#">LESS</a> and <a href="#">Stylus</a>.
</p>
@font-face{
font-family:'icomoon';
src:url('icons/icomoon.ttf');
src:url('icons/icomoon.eot?#iefix') format('embedded-opentype'),
url('icons/icomoon.woff') format('woff'),
url('icons/icomoon.ttf') format('truetype'),
url('icons/icomoon.svg#icomoon') format('svg');
}
.icon-spades:before {
content: "\e906";
}
Luke Pettway
16,593 PointsIn the download, does demo.html work? This is from the Iconmoon site:
Why doesn't my font glyph show up?
Check if the generated demo.html file (after unzipping) has the same issue. If it does, please contact us. If you are trying to install and use the TTF font in a desktop application, see this guide. If you are hosting the fonts yourself, make sure to set CORS headers properly. Check your browser's console to see if there are any reported issues related to the font. If you can see the icons in the demo.html but they don't show up in your own implementation, try to find the difference between the demo and your own code. If you still couldn't figure out what's wrong, try to make a reduced test case and contact us.
Elena Paraschiv
9,938 PointsElena Paraschiv
9,938 PointsHere is my code
Luke Pettway
16,593 PointsLuke Pettway
16,593 PointsI think you may be missing this:
Your icons don't have the font-family applied to them, so they are falling back to whatever the default font specific is. The above code may differ depending on how you output your icons, but setting the font-family to 'iconmoon' should hopefully fix it.