html - How to debug Font-Awesome icons? -



html - How to debug Font-Awesome icons? -

i have been using font-awesome , icons while now, , has been working fine.

today, however, displays blank squares instead of icons. have read many other related questions, none of cases apply me. said, worked before, , did not create changes font-awesome files (i using downloaded version of fa, not cdn) or html templates display icons.

so want start debugging process. 1 illustration this:

<i style="color: orange" class="fa fa-exclamation-triangle"></i>

however, cannot find urls in css of affected elements, when inspecting chrome. see on every icon element though, this:

.fa-warning:before, .fa-exclamation-triangle:before { content: "\f071"; }

where \f071 "blank square" character.

so question is:

where icons come from, , how can debug no-show fa icons, in general?

update

i found out \f071 , friends symbols referring icons, stored in font files. fact show blank squares seems indicate font has not been loaded successfully.

however, checked , client downloads fonts/fontawesome-webfont.woff , fonts/fontawesome-webfont.ttf fine.

also, elements' font correctly set through fa class:

font-family: normal normal normal 14px/1 fontawesome

what else necessary create sure, font has loaded successfully?

fontawesome is... a font!

this means you'll have set of characters, (visually) icons. these characters contained between \e000 , \f8ff (which private utilize area's characters).

when see code:

.fa-warning:before, .fa-exclamation-triangle:before { content: "\f071"; }

it means \f071 character displayed in pseudo-element. it's coupled code, loads fontawesome font .fa elements:

@font-face { font-family: 'fontawesome'; src: url('../fonts/fontawesome-webfont.eot?v=4.2.0'); src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; } .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; }

seeing white square can means:

your font not loaded (most mutual problem) your font not created (re-download it) your css missing font declaration (@font-face {}) your css missing font phone call (font: normal normal normal 14px/1 fontawesome;)

how debug:

check you're using right class name (.fa .fa-foo) check fontawesome css loaded (it should case you're seeing square) double-check font loaded. there have path issue, font/ folder instead of fonts/ have on .htaccess. people makes strong rules impact assets. if ok, seek re-download font (font files have been corrupted)

html css font-awesome

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -