Skip to content

Instantly share code, notes, and snippets.

@Poltergeist
Created March 4, 2013 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Poltergeist/5081173 to your computer and use it in GitHub Desktop.
Save Poltergeist/5081173 to your computer and use it in GitHub Desktop.
tooltip css3
span{
color:#333;
font-size:1.2em;
font-family:'Helvetica';
}
span[data-tooltip]{
color:#396;
position:relative;
display:inline-block;
cursor:help;
}
span[data-tooltip]:before{
display:inline-block;
content:'';
height:.8em;
width:.8em;
background:#33ff00;
margin:0 .2em;
border-radius:700px;
}
span[data-tooltip]:after{
display:block;
content:attr(data-tooltip);
padding:.1em .3em;
background:#33ff00;
position:absolute;
left:0;
margin-left:1em;
top:100%;
display:none;
}
span[data-tooltip]:hover:after{
display:block;
}
<span>Hallo Welt</span>
<span data-tooltip="test">this</span>
<span>is nothing compared to a tooltip</span>
{"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