Reputation: 3314
I have an <li>
that when hovered is supposed to change a number into a unicode icon, for example a play button.
The unicodes keep popping up an icon that looks like this: [?]
I'm assuming it can't find them. I am using font icons in other parts just fine, any ideas?
<ul class="popular-songs">
<li>
<div class="album-cover"><img src="http://newnoisemagazine.com/wp-content/uploads/2014/04/Expire-Pretty-Low-cover.jpg"></div>
<span class="number">
<span>1</span>
</span>
<span>+</span>
<span class="title">Pretty Low</span>
<span class="misc"><i class="fa fa-ellipsis-h"></i></span>
<span class="total-plays">163,957</span></li>
</ul>
CSS:
.popular-songs li .number{
position: relative;
content: '1';
top:0px;
}
.popular-songs li:hover .number span{
display: none;
}
.popular-songs li:hover .number:after{
content: "\f04b";
position:relative;
top:15px;
}
I have tried writing the unicode in every possible way I could think of.
content: "/XXXX";
content: "\XXXX";
content: "XXXX";
content: "[XXXX]";
None of them seem to work for me.
Upvotes: 2
Views: 8719
Reputation: 14927
Add the font-family to your CSS, like:
.popular-songs li:hover .number:after{
font-family: 'FontAwesome';
content: "\f04b";
position:relative;
top:15px;
}
And just for reference, here's FontAwesomes CSS for all icons:
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
Upvotes: 6