All I want to do is replace a background image in CSS with an icon font, not icon image.
I can’t get it done.
This is the CSS property:
.social-networks .twitter{background:url(../images/social/twitter.png);}
This is the code in PHP:
<ul class="social-networks">
<?php if (my_option('twitter_link')): ?>
<li>
<a href="<?php echo my_option('twitter_link'); ?>" class="twitter">twitter</a>
</li>
<?php endif; ?>
The way I insert an incon font is <span class="icon">A</span>
You could try something like this: FIDDLE
Let’s say you have your DIV:
you create your css style like this:
in the property
content
you choose your “letter” and then you can change thefont-size
,font-weight
,color
, etc…There is a content property in css:
http://www.w3schools.com/cssref/pr_gen_content.asp
use navigation text instead of background img.
and set css property for font awesome icon.
here is normal css for icon.
I came up with something interesting, imo: the CSS
element()
function. Currently it works only in firefox (so make sure you are opening example linked at the end in that browser).Here is HTML:
…and CSS with comments:
And finally – there is a working example (jsFiddle).