Some Fontawesome icons not displaying in Safari
Turns out the AdBlock extension for Safari was causing this issue, its back to normal when AdBlock is disabled.
Some FA icons are displayed in FF, Chrome and Safari, but no browser displays them all
I doubt that somebody will be as stupid as I am, but nevertheless I let you know about the mistake in my code.
Font Awesome consists of three fonts which are free to use.
- FA Brands
- FA Regular
- FA Solid
In the *.css they are called with @font-face
and inside of that they are separated by font-family: <Font Name>
.
If you look at my previous code, every font (brands, regular and solid) is called separatly with an individual @font-face
-argument. And that's where the magic happens!
Since FA Regular
and FA Solid
are both part of the family called Font Awesome 5 Free
several browsers seem to struggle with finding the correct font if there are two different fonts declared to be in the same family. The reason FA Brands was displayed properly is that its family is called Font Awesome 5 Brands
.
Long story short. Out of
@font-face {
font-family: 'Font Awesome 5 Brands';
font-style: normal;
font-weight: normal;
src: url("../fonts/fa-brands-400.eot");
src: url("../fonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../fonts/fa-brands-400.woff2") format("woff2"), url("../fonts/fa-brands-400.woff") format("woff"), url("../fonts/fa-brands-400.ttf") format("truetype"), url("../fonts/fa-brands-400.svg#fontawesome") format("svg"); }
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 400;
src: url("../fonts/fa-regular-400.eot");
src: url("../fonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../fonts/fa-regular-400.woff2") format("woff2"), url("../fonts/fa-regular-400.woff") format("woff"), url("../fonts/fa-regular-400.ttf") format("truetype"), url("../fonts/fa-regular-400.svg#fontawesome") format("svg"); }
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 900;
src: url("../fonts/fa-regular");
src: url("../fonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../fonts/fa-solid-900.woff2") format("woff2"), url("../fonts/fa-solid-900.woff") format("woff"), url("../fonts/fa-solid-900.ttf") format("truetype"), url("../fonts/fa-solid-900.svg#fontawesome") format("svg"); }
I made
@font-face {
font-family: 'Font Awesome 5 Brands';
font-style: normal;
font-weight: normal;
src: url("../fonts/fa-brands-400.eot");
src: url("../fonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../fonts/fa-brands-400.woff2") format("woff2"), url("../fonts/fa-brands-400.woff") format("woff"), url("../fonts/fa-brands-400.ttf") format("truetype"), url("../fonts/fa-brands-400.svg#fontawesome") format("svg"); }
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 400, 900;
src: url("../fonts/fa-regular-400.eot");
src: url("../fonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../fonts/fa-regular-400.woff2") format("woff2"), url("../fonts/fa-regular-400.woff") format("woff"), url("../fonts/fa-regular-400.ttf") format("truetype"), url("../fonts/fa-regular-400.svg#fontawesome") format("svg");
src: url("../fonts/fa-solid-900.eot");
src: url("../fonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../fonts/fa-solid-900.woff2") format("woff2"), url("../fonts/fa-solid-900.woff") format("woff"), url("../fonts/fa-solid-900.ttf") format("truetype"), url("../fonts/fa-solid-900.svg#fontawesome") format("svg"); }
And now it works like a charm for all browsers.
Thanks to all your advice and help!
Have a good one,
Marcel
Font awesome - Safari (8.0) not display icons
I changed css link to <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
. Now it's working.
FontAwesome icons are higher up in Safari than Chrome
Adding vertical-align
fixes it:
.fa {
position: relative;
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;
vertical-align: middle; /* Or try bottom or baseline */
}
Related Topics
Is There an Inverse to The CSS "Clip" Property; Hide The Clipped Area
Fixed Vertical Positioning of CSS Within an Iframe
CSS Selector If Exist Adjacent Sibling
Why Are My Google Web Fonts Pixelated
Set Size to Responsive Iframe in Bootstrap
Larger Div Centered Inside Smaller Div
Where to Put CSS3 Media Queries
Broke Page Styles of Vue.Js App (Webpack Template) When Live Changing It in Chrome Devtools
Svg Letter-Spacing Also Applied to Mozilla Firefox
Is There Any Online Text Editor for HTML, CSS with Saving and Syntax Highlighting Facility
Show Truncated Text Normally, But Show Full Text on Hover
Make Element Width Stretch to Fit Its Children When Element's Parent Has Overflow: Auto;
How to Avoid Line Breaks After ":Before" in CSS
How to Change Parent Style by Child: Hover Action in Less