1

I want to develop a floating bar that contains icons (material-icons). Unfortunately, my <a href=> attribute doesn't work and the icons are not clickable.

Any idea how to solve this?

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<ul id="navigation">
  <li class="material-icons md-48 md-dark">video_library
    <a href="https://www.google.com"></a>
  </li>
  <li class="material-icons md-48 md-dark">contact_support
    <a href="https://www.google.com" target="_blank"></a>
  </li>
  <li class="material-icons md-48 md-dark">mail
    <a href="https://www.google.com" target="_blank"></a>
  </li>
</ul>
Paulie_D
  • 107,962
  • 13
  • 142
  • 161
Damien
  • 11
  • 2

2 Answers2

2

The text needs to be inside the link and the classes applied to those links...not the li.

li {
  list-style: none;
  display: inline;
}

a {
  text-decoration: none;
}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<ul id="navigation">
  <li>
    <a href="https://www.google.com" class="material-icons md-48 md-dark">video_library</a>
  </li>
  <li>
    <a href="https://www.google.com" target="_blank" class="material-icons md-48 md-dark">contact_support</a>
  </li>
  <li>
    <a href="https://www.google.com" target="_blank" class="material-icons md-48 md-dark">mail</a>
  </li>
</ul>
Paulie_D
  • 107,962
  • 13
  • 142
  • 161
0

By setting icon inside <a>

 <li>video_library
        <a href="https://www.google.com"><i class="material-icons md-48 md-dark">video_library</i></a>
    </li>
Awais
  • 4,752
  • 4
  • 17
  • 40