Skip to content

Instantly share code, notes, and snippets.

@jonathanmuth
Created November 30, 2015 16:24
Show Gist options
  • Save jonathanmuth/1dc7b68737290c9d902e to your computer and use it in GitHub Desktop.
Save jonathanmuth/1dc7b68737290c9d902e to your computer and use it in GitHub Desktop.
Alma Bubble
<!DOCTYPE html>
<html>
<head>
<style>
a[bubbletooltip]:link, a[bubbletooltip]:visited
{
text-decoration: none;
position: relative;
color : red;
}
a[bubbletooltip]:before
{
content: "";
position: absolute;
border-bottom: 7px solid hsla(0, 0%, 20%, 0.9);
border-left: 7px solid transparent;
border-right: 7px solid transparent;
visibility: hidden;
top: 16px;
left: 50%;
transform: translateX(-50%);
}
a[bubbletooltip]:after
{
visibility: hidden;
position: absolute;
content: attr(bubbletooltip);
padding: 6px 10px;
top: 25px;
left: 50%;
min-width: 256px;
transform: translateX(-50%) translateY(-2px);
background-color: #000;
background-color: hsla(0, 0%, 20%, 0.9);
color: white;
z-index: 2;
border-radius: 2px;
transition: opacity 0.2s $cubic, transform 0.2s $cubic;
}
a[bubbletooltip]:hover:before, a[bubbletooltip]:hover:after
{
visibility: visible;
-moz-transition: visibility 0s linear .3s;
}
</style>
</head>
<body> <br /> <br /> <br /><br />
<p align="center">Hi, <a href="#" bubbletooltip="Hi I am a bubble tooltip. Hi I am a bubble tooltip. Hi I am a bubble tooltip. Hi I am a bubble tooltip. Hi I am a bubble tooltip. Hi I am a bubble tooltip.">This is a demo </a>for a Top Bubble Tooltip</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment