Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make tooltip content stay

Tags:

html

css

tooltip

How do I make the information inside the tooltip stay still. For example, after the tooltip appears, how can I browse over with my mouse to click on a link inside. The tooltip disappears when no longer hovering over the word or image. I want it to stay in one place.

a.tooltip {outline:none; }
a.tooltip strong {line-height:30px;}
a.tooltip:hover {text-decoration:none;} 
a.tooltip span {
    z-index:10;display:none; padding:14px 20px;
    margin-top:-30px; margin-left:28px;
    width:300px; line-height:16px;
}
a.tooltip:hover span{
    display:inline; position:absolute; color:#111;
    border:1px solid #DCA; background:#fffAF0;}
.callout {z-index:20;position:absolute;top:30px;border:0;left:-12px;}
    
/*CSS3 extras*/
a.tooltip span
{
    border-radius:4px;
    box-shadow: 5px 5px 8px #CCC;
}
<!--First tooltip-->
<a href="#" class="tooltip">
    Tooltip
    <span>
        <img class="callout" src="cssttp/callout.gif" />
        <strong>Most Light-weight Tooltip</strong><br />
        This is the easy-to-use Tooltip driven purely by CSS.
    </span>
</a>

<!--Second tooltip-->
<a href="#" class="tooltip">
    <img src="/tooltip/css-tooltip-image.gif" />
    <span>
        <img class="callout" src="cssttp/callout.gif" />
        <img src="/tooltip/src/tooltips-cd2.jpg" style="float:right;" />
        <strong>CSS only Tooltip</strong><br />
        Pure CSS popup tooltips with clean semantic XHTML.
    </span>
</a>
like image 444
Moby Sanstone Avatar asked Feb 01 '16 22:02

Moby Sanstone


People also ask

How do I make tooltip stay?

To create a tooltip that stays open until the mouse button is pressed when it is outside the tooltip, you must set both the StaysOpen property and the IsOpen property to true .

What is rel tooltip?

Tooltips are just cosmetic though. Not css style but just a bit of JS to change how a title attribute is presented. The "rel" attribute is meant to be used to tell a bot (such as google) about the nature of a link.

How do you make a hover pop-up in HTML?

To make a simple tooltip, we'll first create the HTML element that triggers the tooltip when hovered over. We'll create this element as a div and assign it the class hover-text. Next, we'll create the element for the tooltip itself. This will be a span element with the class tooltip-text.


1 Answers

Consider this:

.tooltip{
  display: inline;
}

.tooltip:hover:after{
  background: rgba(0,0,0,.7);
  border-radius: 5px;
  color: #fff;
  content: attr(title);
  padding: 5px 15px;
  margin-left: 10px;
  z-index: 99;
  width: 220px;
}
<a href="#" title="This is some information for our tooltip." class="tooltip">
	<span title="More">CSS3 Tooltip</span>
</a>
like image 54
Pmpr.ir Avatar answered Oct 12 '22 13:10

Pmpr.ir