Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I show only outline for a Font Awesome icon?

Tags:

html

css

I am working with the tag icon from FA http://fontawesome.io/icon/tag/ and what I wish to do is to display only the outline (red) of it and make the inside transparent. fa-tag-o does not work. I've also tried fa-tag-empty and CSS like

.fa{
   color: transparent;
   -webkit-text-stroke-width: 1px;
   -webkit-text-stroke-color: red;
 }

but nothing seems to work. Is there any possible way I can do this?

Thanks in advance

like image 312
L.D Avatar asked Dec 24 '16 23:12

L.D


People also ask

How do you put a border on Font Awesome icons?

To increase fa-border-all font awesome icon size, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes along with icon class fa-border-all. Increase in icon size will be relative to their parent container.

Can I modify Font Awesome icons?

Select the SVG of font-awesome located in your extracted zip inside fonts. Repeat the procces uploading your own svg files. Inside Home (at the header of the page) Select the icons you want to download, customize them to give your custom names and select publish to have a link or download the fonts and css.

How do I show Font Awesome icons?

You can place Font Awesome icons just about anywhere using the CSS Prefix fa and the icon's name. Font Awesome is designed to be used with inline elements (we like the <i> tag for brevity, but using a <span> is more semantically correct). icon If you change the font-size of the icon's container, the icon gets bigger.

Why some of the Font Awesome icons does not show?

Are you using Font Awesome Free or Pro? - Some icons are only available in Font Awesome Pro. Double-check that the icon you want is in the version of Font Awesome you're referencing and using. Also, make sure you are using and referencing the right style prefix and supporting files to use Pro icons.


2 Answers

There is no tag like fa-tag-o you can use fa-tag or fa-tags your code works fine.. U can use flip you can use rotate u can make ur own custom css tor fa-tag like I made a custom class for the second fa-custom livefiddle fa-4x here x means em so fa-4x means fa size 4em .

.fa.fa-tag{
   color: transparent;
   -webkit-text-stroke-width: 2px;
   -webkit-text-stroke-color: red;
 }
.fa.custom-fa{
 font-size:12em;
 -webkit-text-stroke-color: blue;
color:transparent;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"  rel="stylesheet"/>
<i class="fa fa-tag fa-rotate-90 fa-4x" aria-hidden="true"></i><br><br>

<i class="fa fa-tag fa-flip-horizontal custom-fa" aria-hidden="true"></i>
like image 95
Baezid Mostafa Avatar answered Oct 15 '22 01:10

Baezid Mostafa


If you know the background color beforehand, you can use text-shadow, and set the color of the icon to the background color.

.fa-tag {
  text-shadow: 0px 0px 1px red;
  color: white;  
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

<i class="fa fa-tag fa-flip-horizontal fa-lg" aria-hidden="true"></i>

To make it more solid, apply the shadow twice:

.fa-tag {
  text-shadow: 0px 0px 1px red, 0px 0px 1px red;
  color: white;  
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

<i class="fa fa-tag fa-flip-horizontal fa-lg" aria-hidden="true"></i>
like image 40
Ori Drori Avatar answered Oct 15 '22 02:10

Ori Drori