G
G
gregorypetrov2017-09-25 18:36:22
css
gregorypetrov, 2017-09-25 18:36:22

How to include icon font Material Design Icons locally?

Good evening, colleagues!
There is such an icon font - Material Design Icons ( https://material.io/icons/ ). I downloaded it as a single ttf file.
Added in CSS:

@font-face {
    font-family : 'MaterialIcons';
    src         : url('/fonts/MaterialIcons-Regular.ttf');
    src         : url('/fonts/MaterialIcons-Regular.ttf')
    format('woff'), url('/fonts/MaterialIcons-Regular.ttf') format('truetype');
    font-weight : normal;
    font-style  : normal;
}

1) How to connect it (locally) so that you can assign its icons to divs like this -
.div-button-download:before {
  font-family: 'Material Icons';
  content: "\f006";
}

2) And where can I find out the meanings of these very codes corresponding to the desired icon, like
"\f006";
?
Thanks in advance for your replies!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Alexandrov, 2017-09-25
@BraveHeart

Not that is loaded, the font consists of not only one *.ttf file.
Or download everything to yourself,
or take the link
Read more google.github.io/material-design-icons/#icon-font-...

E
Egor, 2019-12-07
@Softwider

To connect locally:
1) Download archive link in github .
2) Extract the "iconfont" folder and put it in the project (684 KB).
3) Connect. For example via HTML:
4) Select and add icon in HTML:
5) Style:

.material-icons {
    color: #ffffff; 
    font-size: 24px;
}

A
Alexander Kalinin, 2019-08-01
@kentovsky

<link href="https://cdn.materialdesignicons.com/3.8.95/css/materialdesignicons.min.css"
          rel="stylesheet">

Instead of 3.8.95 put the desired version

F
fv_furniture, 2019-11-12
@fv_furniture

https://materialdesignicons.com/cdn/2.0.46/
here is a complete list of these icons

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question