Are the icons inside the font good for the site?

I want to create a special font containing only icons. and for each letter an icon will be displayed. I want to embed this font in css. and use it if I need an icon:

<a class="icon">f</a>

and css

<link href='http://fonts.mysite.com/css?family=MyFontWithIcons' rel='stylesheet' type='text/css'>

which contains:

@media screen {
@font-face {
  font-family: 'MyFontWithIcons';
  font-style: normal;
  font-weight: normal;
  src: local('MyFontWithIcons'), url('http://fonts.mysite.com/font?MyFontWithIcons') format('truetype');
}
}

and show badges with a badge class:

.icon {font-family: 'MyFontWithIcons'; }

And the letter "f" will be replaced by an icon inside the font, which is in place of the letter f. and css works with the font and replaces f with an icon inside the font. I think this is a good idea or not? The font file is smaller than many image icons. and also with this technique can i use diffirent font colors = diffirent icon colors? sizes etc. So is this a good idea or not?

+3
source share
4

, , :

  • , @font-face
  • (, , , HTML- ..).
  • , "", , .
  • @font-face (, -, Lynx, Links2 ELinks Unix/Linux)
  • -, , , . (, )
  • NoScript , 0- .

alt .

, , , Unicode . , , , , ( PUA ), , , , PUA.

, Modernizr ( , Modernizr.fontface), .

+6

, (). , 2 ( ), . . "", <img> -tag . html. css.

bandwith; .

0
  • @font-face . - , . IE6
  • : , "f",
  • , .
0

. , . :

  • , . , .
  • css, , js . , : ) , , .. , ) (, , ) (, , dark-theme, , tropical-theme)
  • ( ), . : ..
  • , , , , , , .
  • , fontello, . , fontello API, .
0
source

Source: https://habr.com/ru/post/1763362/


All Articles