#tooltip
{
    text-align: center;
    color: #fff;
    background: rgba(0,0,0,0.9);
    position: absolute;
    border-radius: 2px;
    z-index: 100;
    padding: 10px;
    word-wrap: break-word;
    box-shadow: 11px 12px 12px -7px rgba(0,0,0,0.3);
    transition: opacity 0.5s, transform 0.6s;
    transform: scale3d(1,1,1);
    transform-origin: 50% 120%;
    transition-timing-function: ease, cubic-bezier(0.6,0,0.4,1);
}
#tooltip:hover{
    transform: scale3d(1,1,1);
}
#tooltip:after /* triangle decoration */
{
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(0,0,0,0.9);
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    margin-left: -10px;
}

#tooltip.top:after
{
    border-top-color: transparent;
    border-bottom: 10px solid rgba(0,0,0,0.9);
    top: -20px;
    bottom: auto;
}

#tooltip.left:after
{
    left: 10px;
    margin: 0;
}

#tooltip.right:after
{
    right: 10px;
    left: auto;
    margin: 0;
}