Jump to content

Solved: FontAwesome Symbols


Recommended Posts

The cartblock module uses a ":before" css tag with a "content" definition:

 



.shopping_cart > a:first-child:before {
   content: "\f07a";
   display: inline-block;
   font-family: "FontAwesome";


 

However, this doesn't allow the icon to be repositioned like I need. I need it to be its own element. I've tried two methods (see below) unsuccessfully. Any suggestions? Is making a transparent .gif of the icon my only option?

 



HTML:
<div id="cart_icon">\f07a</div>
 
CSS:
#cart_icon {
   background-color: black;
   font-family: "FontAwesome";
   height: 25px;
   width: 25px; }




HTML:
<div id="cart_icon">&nbsp</div>
 
CSS:
#cart_icon {
   background-color: black;
   content: "\f07a";
   font-family: "FontAwesome";
   height: 25px;
   width: 25px; }


Edited by jleesaxon (see edit history)
Link to comment
Share on other sites

Okay, so I looked at the tags from CartExpert's suggestion and figured out that these icons will not work without the ":before" (or ":after"). I have no idea why this is, but for anyone having the same problem here's the proper code:

 

 

HTML:
<div id="cart_icon"></div>
 
CSS:
#cart_icon:before {
   background-color: black;
   content: "\f07a";
   font-family: "FontAwesome"; }

 

and, if you've deleted the default global.css, you'll also need this somewhere:

 

 

@font-face {
  font-family: 'FontAwesome';
  src: url("../font/fontawesome-webfont.eot?v=3.2.1");
  src: url("../font/fontawesome-webfont.eot?#iefix&v=3.2.1") format("embedded-opentype"), url("../font/fontawesome-webfont.woff?v=3.2.1") format("woff"), url("../font/fontawesome-webfont.ttf?v=3.2.1") format("truetype"), url("../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1") format("svg"); }
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...