Skip to content

Instantly share code, notes, and snippets.

@rodi01
Created January 31, 2012 09:33
Show Gist options
  • Save rodi01/1709630 to your computer and use it in GitHub Desktop.
Save rodi01/1709630 to your computer and use it in GitHub Desktop.
CSS Tooltip
.tooltip { position: relative; }
.tooltip span {
position: absolute;
right: 0;
top: -35px;
display: none;
min-width: 50px;
padding: 3px 8px;
white-space: nowrap;
font-size: 11px;
text-align: center;
background-color: rgba(0,0,0,.8);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
.tooltip span small {
position: absolute;
right: 10px;
bottom: -6px;
border-top: 6px solid rgba(0,0,0,.8);
border-left: 6px solid transparent;
}
.tooltip:hover span { display: block; }
<a class="tooltip" href="#">
My Link <span>Cool Tooltip<small></small></span>
</a>
.tooltip span { background-color: #000; }
.tooltip span small { border-top: 6px solid #000; }
/* IE 6 Tooltip Arrow Fix */
*html .tooltip span small {
border-left: 6px solid #363636; /* Match the color of the background */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment