Created
September 11, 2016 12:09
-
-
Save aaronvanston/29bc06aabef814bd230481371eee6aec to your computer and use it in GitHub Desktop.
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
[data-tip] { | |
position: relative; | |
} |
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
[data-tip]:before { | |
content: ''; | |
position: absolute; | |
top: 100%; | |
left: calc(50% - 6px); | |
margin-top: -6px; | |
pointer-events: none; | |
border: 6px solid transparent; | |
border-bottom-color: #333; | |
} |
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
[data-tip]:after { | |
content: attr(data-tip); | |
position: absolute; | |
top: 100%; | |
left: 50%; | |
margin-top: 6px; | |
background-color: #333; | |
color: #fff; | |
border-radius: 4px; | |
white-space: nowrap; | |
font-size: 0.8em; | |
padding: 0.5em 1em; | |
z-index: 100; | |
transform: translate(-50%, 0); | |
} |
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
[data-tip]:before, | |
[data-tip]:after { | |
position: absolute; | |
top: 100%; | |
z-index: 100; | |
visibility: hidden; | |
opacity: 0; | |
} |
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
[data-tip]:hover:before, | |
[data-tip]:hover:after { | |
visibility: visible; | |
opacity: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment