Materialize CSS | Tooltips

Tooltips are small, textual but interactive hints that are used mainly for the graphical purpose. It helps the icons or buttons to give clarification of its function. To use this, tooltipped class is added along with its position such as: top, bottom, left or right. Syntax is as follow:

 <a class="btn tooltipped" data-position="bottom" data-tooltip="I am a tooltip">Hover me!</a>

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <meta
            name="viewport"
            content="width = device-width,
                       initial-scale = 1"
        />
        <link rel="stylesheet"
              href=
        <link rel="stylesheet" 
              href=
        <script type="text/javascript"
                src=
      </script>
        <script src=
      </script>
    </head>
  
    <body class="container">
        <div class="fixed-action-btn toolbar">
            <strong>Toolbar</strong>
            <a class="btn-floating btn-large red">
                <i class="large material-icons">
                  border_color</i>
            </a>
            <ul>
                <li class="waves-effect waves-light">
                    <a href="#!">
                      <i class="material-icons">
                        insert_chart</i></a>
                </li>
                <li class="waves-effect waves-light">
                    <a href="#!">
                      <i class="material-icons">
                        format_quote</i></a>
                </li>
                <li class="waves-effect waves-light">
                    <a href="#!">
                      <i class="material-icons">
                        publish</i></a>
                </li>
                <li class="waves-effect waves-light">
                    <a href="#!">
                      <i class="material-icons">
                        attach_file</i></a>
                </li>
            </ul>
        </div>
        <h2>Tooltips</h2>
        <div class="row">
            <div class="col s6">
                <a class="btn tooltipped green" 
                   data-position="bottom" 
                   data-delay="50" 
                   data-tooltip="Additinal Information">
                  Hover me!
              </a>
            </div>
            <div class="col s6">
                <a class="btn tooltipped green" 
                   data-position="top" 
                   data-delay="50" 
                   data-tooltip="Additinal Information">
                  Hover me!
              </a>
            </div>
        </div>
        <div class="row">
            <div class="col s6">
                <a class="btn tooltipped green"
                   data-position="left" 
                   data-delay="50" 
                   data-tooltip="Additinal Information">
                  Hover me!
              </a>
            </div>
            <div class="col s6">
                <a class="btn tooltipped green" 
                   data-position="top" 
                   data-delay="50" 
                   data-tooltip="Additinal Information">
                  Hover me!
              </a>
            </div>
        </div>
    </body>
</html>

chevron_right


Output:




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.