3

I don't want icon text to be displayed in case the page fails to load the icons library. For example the below code should display the invite person icon-

<i style="font-size:16px;color:grey" class="material-icons">person_add</i>

But when the page fails to load for some reason(like slow internet connection), the above code is showing text - "person_add" which looks very insulting. Is there any solution for this issue, I infact don't want the text to be appeared in any way even if the library is no present.

Karan Parte
  • 37
  • 1
  • 4

2 Answers2

0

You have a problem in your link:

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

Remove the ; and add https:// in the beginning of the href:

<head>    
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">    
</head>
Coral Kashri
  • 3,436
  • 2
  • 10
  • 22
0

First Clear Your cache
Then add the link in your head section like this

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

Then in your body section add this

  <i style="font-size:16px;color:grey" class="material-icons">person_add</i>

it should look like this

<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
  <meta charset="utf-8">
  <title></title>
  <!--your code-->

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

</head>

<body>
  <!--your code-->

  <i style="font-size:16px;color:grey" class="material-icons">person_add</i>

  <!--your code-->

</body>

</html>