Last active
May 5, 2017 08:45
-
-
Save yjose/b9366f4e6f914529455e34751c5d82a1 to your computer and use it in GitHub Desktop.
step1-tooltip.css
This file contains hidden or 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
button{ | |
margin:auto; | |
background: #3498db; | |
font-family: Arial; | |
color: #ffffff; | |
font-size: 14px; | |
} | |
[tooltip]{ | |
margin:20px; | |
position:relative; | |
} | |
[tooltip]::before { | |
content: ""; | |
position: absolute; | |
top:-6px; | |
left:50%; | |
transform: translateX(-50%); | |
border-width: 4px 6px 0 6px; | |
border-style: solid; | |
border-color: rgba(0,0,0,0.7) transparent transparent transparent; | |
z-index: 100; | |
} | |
[tooltip]::after { | |
content: attr(tooltip); | |
position: absolute; | |
left:50%; | |
top:-6px; | |
transform: translateX(-50%) translateY(-100%); | |
background: rgba(0,0,0,0.7); | |
text-align: center; | |
color: #fff; | |
padding:4px 2px; | |
font-size: 12px; | |
min-width: 80px; | |
border-radius: 5px; | |
pointer-events: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment