Skip to content

Instantly share code, notes, and snippets.

@sambody
Created June 29, 2013 21:50
Show Gist options
  • Save sambody/5892818 to your computer and use it in GitHub Desktop.
Save sambody/5892818 to your computer and use it in GitHub Desktop.
CSS: arrow down on tooltip with border
/*
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