LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » CSS Codes / HTML-CSS-PHP-JavaScript » 5 Stylish And Awesome Pure CSS Tooltip Widgets

5 Stylish And Awesome Pure CSS Tooltip Widgets

5-Stylish-And-Awesome-Pure-CSS-Tooltip-Widgets
A tooltip is a popup that appears when the mouse hovers over a particular term or a help icon. On a mobile device appearance and disappearance of the tooltip are touch events or it can be completely deactivated. Tooltips can be used in many useful ways:

  • Add an abbreviation, synonyms and acronyms.
  • Showcase one of your products and link the tooltip term to a product page.
  • Place an advertisement or affiliate link inside the tooltip.
  • Show related images to the linked term.
  • Place a translated word in a different language.
  • Provide more information on the term.

Tooltip is one of the features most of you wanted to insert in your Weebly site to provide additional information on specific content. There are lots of ways to add a tooltip to your content:

In this article, we will explain how to add a tooltip to the site using simple HTML and CSS code. It is also possible to add tooltips using scripts which we will not cover in this tutorial.

There are many code snippets available online or on many other blogs and websites but everyone is not able to optimize your blog or website so you need some optimized code snippets. So now checkout out the code snippet for your blog and website that will give you all features for your desired code. Now grab the ready-to-use code and paste it where you want.

Table of Contents

Recommended For You:
Latest Javascript Interview Questions & Answers

Features:

  1. Light Weight.
  2. Pure CSS Code.
  3. Cross Browser.
  4. No External Files.
  5. Fully Customizable.
  6. Responsive.

How To Add 5 Stylish And Awesome Pure CSS Tooltip Widgets?

There are a few easy and understandable steps to achieve your desired functionality that we are gonna share below. Follow each step perfectly.

CSS:

<style>
/*BasicTool Tip*/
.demo,.demo p{margin:4em 0;text-align:center}
[data-tool-tip]{position:relative;z-index:2;cursor:pointer}
[data-tool-tip]:before,[data-tool-tip]:after{visibility:hidden;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);filter:progid: DXImageTransform.Microsoft.Alpha(Opacity=0);opacity:0;pointer-events:none}
[data-tool-tip]:before{position:absolute;bottom:150%;left:50%;margin-bottom:5px;margin-left:-80px;padding:7px;width:160px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;background-color:#000;background-color:hsla(0,0%,20%,0.9);color:#fff;content:attr(data-tool-tip);text-align:center;font-size:14px;line-height:1.2}
[data-tool-tip]:after{position:absolute;bottom:150%;left:50%;margin-left:-5px;width:0;border-top:5px solid #000;border-top:5px solid hsla(0,0%,20%,0.9);border-right:5px solid transparent;border-left:5px solid transparent;content:" ";font-size:0;line-height:0}
[data-tool-tip]:hover:before,[data-tool-tip]:hover:after{visibility:visible;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);filter:progid: DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}
/*Advance Tool Tip*/
#tool_tip{background-color:rgba(128,128,128,0.07);border-radius:4px;padding:40px 40px 10px 30px;max-width:600px;position:relative;margin:0 auto}
.help-tip{position:absolute;top:18px;right:18px;text-align:center;background-color:#4F798E;border-radius:50%;width:24px;height:24px;line-height:26px;cursor:default}
.help-tip:before{content:'?';font-weight:700;color:#fff}
.help-tip:hover p{display:block;transform-origin:100% 0;-webkit-animation:fadeIn .3s ease-in-out;animation:fadeIn .3s ease-in-out}
.help-tip p{display:none;text-align:left;background-color:#1E2021;padding:20px;width:300px;position:absolute;border-radius:3px;box-shadow:1px 1px 1px rgba(0,0,0,0.2);right:-4px;color:#FFF;font-size:13px;line-height:1.4}
.help-tip p:before{position:absolute;content:'';width:0;height:0;border:6px solid transparent;border-bottom-color:#1E2021;right:10px;top:-12px}
.help-tip p:after{width:100%;height:40px;content:'';position:absolute;top:-40px;left:0}
@-webkit-keyframes fadeIn {
0%{opacity:0;transform:scale(0.6)}
100%{opacity:100%;transform:scale(1)}
}
@keyframes fadeIn {
0%{opacity:0}
100%{opacity:100%}
}
@media screen and (max-width: 480px) {
.help-tip p{width:200px}
}
</style>

HTML:

<!-- Basic Tooltip-->
<p class="demo" data-tool-tip="Tooltip with custom CSS">Move your mouse over to see this tooltip with custom CSS code</p>
<!-- Text Tooltip-->
<div id="tool_tip">
<div class="help-tip">
<p>This is a tooltip appears on mouse hovering.</p>
</div>
<p>This is a simple tooltip with just text display on hovering. Check it!</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu diam consectetur, facilisis lorem in, condimentum est. Etiam at leo quis ligula ullamcorper varius.</p>
</div>

<!-- Tooltip with HTML Content -->
<div id="tool_tip">
<div class="help-tip">
<p>This is a tooltip with <b>HTML tags!</b> inside. <a href="https://www.webnots.com/">Here is a link!</a> You can insert any <i>HTML tag!</i></p>
</div>
<p>This tooltip has HTML tags inside. Check it!</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu diam consectetur, facilisis lorem in, condimentum est. Etiam at leo quis ligula ullamcorper varius.</p>
</div>

<!-- Tooltip with Image inside -->
<div id="tool_tip">
<div class="help-tip">
<p>This tooltip has a picture too! < /br>< /br></p><p><img src="https://img.webnots.com/2015/06/Weebly-Site-Building.png" width="300" /></p>
</div>
<p>Also include a showcasing image inside the tooltip. Check it!</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu diam consectetur, facilisis lorem in, condimentum est. Etiam at leo quis ligula ullamcorper varius.</p>
</div>

Customization:

No need to customize it. Just copy-paste. Rest edit the code as per comments and need. Remember to add JavaScript after HTML code.

Recommended For You:
How To Create Resizable Split DIVs Using Pure JavaScript?

Troubleshooting the Errors:

Do it with concentration and patience. Check your all steps and again and all codes or scripts. If you find any error you can contact us anytime via comment or better via email, We are always here to help you.

Final Words:

That’s all we have. We hope that you liked this article. If you have any problem with this code in your template then feel free to contact us with a full explanation of your problem. We will reply to you as time allows us If you have any doubts or problems please comment below. We are happy to help you! If you liked this article, Don’t forget to share this with your friends so they can also take benefit from it and leave.

You Like It, Please Share This Recipe With Your Friends Using...

Be the first to write a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *