Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Materializecss icons not working?

Tags:

materialize

I am using materializecss. But I can't get the icons to work it says the word but doesn't show the icon?

I included the materializecss and the js but still not working...

Anyone know how to fix this?

like image 815
Aapje Avatar asked Nov 22 '15 14:11

Aapje


People also ask

How do you import icons into CSS?

To insert an icon, add the name of the icon class to any inline HTML element. The <i> and <span> elements are widely used to add icons. All the icons in the icon libraries below, are scalable vector icons that can be customized with CSS (size, color, shadow, etc.)

What are icons in HTML?

Icons can be defined as the images or symbols used in any computer interface refer to an element. It is a graphical representation of a file or program that helps the user to identify about the type of file quickly. Using the icon library is the easiest way to add icons to our HTML page.

What is materialize CSS?

Materialize CSS is a design language that combines the classic principles of successful design along with innovation and technology. It is created and designed by Google. Google's goal is to develop a system of design that allows for a unified user experience across all its products on any platform.


2 Answers

you have to include the icons with this link:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

place this somewhere in your head and it will work!

like image 53
C.Schubert Avatar answered Oct 15 '22 23:10

C.Schubert


You can perform the following steps to render the icon -

  1. add this link in your html page - <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

  2. open the browser and you will see that icon has rendered. but we dont want the icon to be rendered using googleapis.

  3. open the console and go to the src of google apis and open the css file, and copy the whole css and add the css into a css file or materialize.min.css.

  4. you will see the font url in the css that you just copied, open that url in the browser and the file of woff2 format will be downloaded.

  5. now just copy the file into the font folder and change the src of the font in the css file to point to this file.

  6. remove the link that you included in step -1 .

refresh the page, you will see that icon has rendered.

Thanks

like image 35
Ujjwal Kumar Gupta Avatar answered Oct 15 '22 23:10

Ujjwal Kumar Gupta