Created
December 27, 2012 21:12
-
-
Save therealklanni/4392011 to your computer and use it in GitHub Desktop.
Simple CSS3 Tooltip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple CSS3 Tooltip | |
*/ | |
.tooltip{ | |
display: inline; | |
position: relative; | |
} | |
.tooltip:hover:after{ | |
background: #333; | |
background: rgba(0,0,0,.8); | |
border-radius: 5px; | |
bottom: 26px; | |
color: #fff; | |
content: attr(title); | |
left: 20%; | |
padding: 5px 15px; | |
position: absolute; | |
z-index: 98; | |
width: 220px; | |
} | |
.tooltip:hover:before{ | |
border: solid; | |
border-color: #333 transparent; | |
border-width: 6px 6px 0 6px; | |
bottom: 20px; | |
content: ""; | |
left: 50%; | |
position: absolute; | |
z-index: 99; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- content to be placed inside <body>…</body> --> | |
<br><br><br><br><br><br><br><br> | |
<span title="This is some information for our tooltip." class="tooltip">CSS3 Tooltip</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment