Open In App

Foundation CSS Tooltip Top

Improve
Improve
Like Article
Like
Save
Share
Report

Foundation CSS is an open-source & responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails to look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. It is more sophisticated, flexible, and easily customizable. It also comes with CLI, so it’s easy to use it with module bundlers. It offers the Fastclick.js tool for faster rendering on mobile devices.

A Tooltip is a small text or sometimes a word that appears when the user moves the mouse over a particular word or a particular button or control in the website. Foundation CSS has multiple tooltip variations such as Tooltip top, Tooltip clicking, Tooltip left, and Tooltip Right. In this article, we will learn about the Tooltip Top in the Foundation CSS.

Tooltip Top is used to positions the tooltip to the Top of the word. To use Tooltip Top in the Foundation CSS, we use the “top” class. The top class positions the tooltip to the top of the <span> element.

Foundation CSS Tooltip Top Class:

  • top: The left class is used to position the tooltip to the top of the <span>.

Syntax:

<span data-tooltip 
      class="top" 
      title="...">
      ...
</span>

Example 1: This example demonstrates the Top Tooltip variation in the Foundation CSS.

HTML




<!doctype html>
<html>
  
<head>
    <title>Foundation CSS Tooltip Top</title>
    <!-- Compressed CSS -->
    <link rel="stylesheet"
          href=
      
        <!-- Compressed JavaScript -->
        <script src=
        </script>
        <script src=
        </script>
</head>
  
<body style="padding: 100px;">
    <h1 style="color:green;">GeeksforGeeks</h1>
    <h1>Foundation CSS Top tooltip</h1>
    <span data-tooltip  class="has-tip top"
          tabindex="1" 
          title="Top ToolTip">
        Top Tooltip element
    </span>
    <script>
        $(document).foundation();
    </script>
</body>
</html>


Output:

Foundation CSS Tooltip Top

Foundation CSS Tooltip Top

Example 2: This example demonstrates the Top Tooltip variation in different HTML elements in the Foundation CSS.

HTML




<!doctype html>
<html>
  
<head>
    <title>Foundation CSS Tooltip Top</title>
    <!-- Compressed CSS -->
    <link rel="stylesheet" 
          href=
      
        <!-- Compressed JavaScript -->
        <script src=
        </script>
        <script src=
        </script>
</head>
  
<body style="padding: 100px;">
    <h1 style="color:green;">GeeksforGeeks</h1>
    <h1>Foundation CSS Top tooltip</h1>
    <span data-tooltip  class="has-tip Top" 
          tabindex="1" title="Top Tip">Span</span>
    <br/>
    <h6 data-tooltip  class="has-tip Top" 
        tabindex="1" title="Top Tip">h6</h6>
    <br/>      
    <h5 data-tooltip  class="has-tip Top" 
        tabindex="1" title="Top Tip">h5</h5>
    <br/>
    <h4 data-tooltip  class="has-tip Top" 
        tabindex="1" title="Top Tip">h4</h4>
    <br/>
    <h3 data-tooltip  class="has-tip Top" 
        tabindex="1" title="Top Tip">h3</h3>
    <br/>
    <h2 data-tooltip  class="has-tip Top" 
        tabindex="1" title="Top Tip">h2</h2>
    <br/>
    <h1 data-tooltip  class="has-tip Top" 
        tabindex="1" title="Top Tip">h1</h1>
    <br/>
    <script>
        $(document).foundation();
    </script>
</body>
</html>


Output:

Foundation CSS Tooltip Top

Foundation CSS Tooltip Top

Reference: https://get.foundation/sites/docs/tooltip.html#tooltip-top



Last Updated : 05 Mar, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads