0

I'm trying to use Ionicons in buttons of Materialize but it isn't showing up instead I'm getting an odd box.

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

<head>
    <title>Materialize</title>
    <link rel="stylesheet" type="text/css" href="css/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="css/ionicons.min.css">
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
</head>

<body>
    <script type="text/javascript" src="https://code.jquery.com/jquery-
    2.1.1.min.js"></script>
    <script type="text/javascript" src="js/materialize.min.js"></script>
    <a class="btn btn-floating btn-large cyan pulse"><i class="ion-social-
    facebook"></i></a>
    <a class="btn btn-floating btn-large cyan pulse"><i class="ion-social-
    twitter"></i></a>
</body>

<html>

This is what I'm getting -

enter image description here

Germa Vinsmoke
  • 3,541
  • 4
  • 24
  • 34

1 Answers1

1

Please tell me that you're not actually splitting the rows in the mid of a class name... and that you hope everything works...

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Materialize</title>
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.3/css/materialize.min.css">
  <link rel="stylesheet" type="text/css" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">

  <meta name="viewport" content="width=device-width,initial-scale=1.0" />
</head>

<body>
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  <script type="text/javascript" src="js/materialize.min.js"></script>
  <a class="btn btn-floating btn-large cyan pulse"><i class="ion-social-facebook"></i></a>
  <a class="btn btn-floating btn-large cyan pulse"><i class="ion-social-twitter"></i></a>
</body>

result:

enter image description here

  • I edited the line and it worked, earlier I was using the downloaded file of Ionicons. Can you tell me what's the difference in between those two files? – Germa Vinsmoke Feb 03 '18 at 06:22
  • your link was using a relative path, meaning that in the same directory where you placed your html file there is a css folder with the .css files in it. Is it the case? – Giovanni Valerio Feb 03 '18 at 12:09
  • Yes, A css folder which was having the css file of Ionicon – Germa Vinsmoke Feb 03 '18 at 14:31
  • I reproduced your situation and it still works fine with the files (downloaded from the links that I put in the links) in a local folder... maybe the css file was not properly downloaded? – Giovanni Valerio Feb 03 '18 at 14:40
  • I've used that file earlier in simple CSS without any framework, at that time it was working fine, dunno what happened in this file – Germa Vinsmoke Feb 03 '18 at 17:43