Created
June 29, 2013 21:50
-
-
Save sambody/5892818 to your computer and use it in GitHub Desktop.
CSS: arrow down on tooltip with border
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
/* | |
check in IE, might need ":" instead of "::" | |
HTML: <p class="tooltip">Some text</p> | |
*/ | |
/* tooltip element with border */ | |
.tooltip { | |
position:relative; | |
padding:15px; | |
margin:1em 0 3em; | |
border:5px solid #5a8f00; /* green */ | |
color:#333; | |
background:#fff; | |
} | |
/* triangle green, first, below */ | |
.tooltip::before { | |
content:""; | |
position:absolute; | |
bottom:-20px; | |
left:40px; | |
border-width:20px 20px 0; | |
border-style:solid; | |
border-color:#5a8f00 transparent; | |
} | |
/* triangle white, on top */ | |
.tooltip::after { | |
content:""; | |
position:absolute; | |
bottom:-13px; | |
left:47px; | |
border-width:13px 13px 0; | |
border-style:solid; | |
border-color:#fff transparent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment