Open In App

Foundation CSS Tooltip Right and Left

Last Updated : 28 Feb, 2022
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 left and right.

Tooltip left and right is used to position the tooltips to the right and left of the word. To use Tooltip left and right in the Foundation CSS, we use the “left” and “right” classes. The left and right classes position the tooltip to the left and right of <span> respectively. 

Foundation CSS Tooltip left and right Classes:

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

Syntax:

<span data-tooltip class="left/right" 
    tabindex="1" title="...">...</span>

Example 1: This example demonstrates the Right Tooltip variation in different elements.

HTML




<!doctype html>
<html>
  
<head>
    <!-- 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 tooltip</h1>
  
    <span data-tooltip class="has-tip right" 
        tabindex="1" title="Right Tip">Span</span><br />
  
    <h6 data-tooltip class="has-tip right" 
        tabindex="1" title="Right Tip">h6</h6><br />
  
    <h5 data-tooltip class="has-tip right" 
        tabindex="1" title="Right Tip">h5</h5><br />
  
    <h4 data-tooltip class="has-tip right" 
        tabindex="1" title="Right Tip">h4</h4><br />
  
    <h3 data-tooltip class="has-tip right" 
        tabindex="1" title="Right Tip">h3</h3><br />
  
    <h2 data-tooltip class="has-tip right" 
        tabindex="1" title="Right Tip">h2</h2><br />
  
    <h1 data-tooltip class="has-tip right" 
        tabindex="1" title="Right Tip">h1</h1><br />
  
    <script>
        $(document).foundation();
    </script>
</body>
  
</html>


Output:

Output

Example 2: This example demonstrates the Left Tooltip variation in different elements.

HTML




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


Output:

Output

Reference: https://get.foundation/sites/docs/tooltip.html#tooltip-right-and-left



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads