


.alert {
    padding: 15px;
    margin: 50px 0 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    position: relative;
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
    font-size: 0.85em;
    transition: all 1s;
}
.alert::after, .alert::before {
    content: 'X'; /*attr(data-tooltip); /* Выводим текст */
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
    font-size: 0.85em;
    padding: 0;
    line-height: 40px;
    text-align: center;
    font-weight: 900;
    font-family: cursive;
    cursor: pointer;
}
.alert::before {
    display: none;
    content: 'This is a Title'; /*attr(data-tooltip); /* Выводим текст */
    top: -105%;
    width: auto;
    border: inherit;
    border-radius: inherit;
    padding: 0 0.4em;
    background: rgba(0, 0, 0, 0.48);
    color: white;
}
.alert.hover::after {
    color: white;
    filter: sepia(10%);
    transform: scale(1.1);
    border-radius: inherit;
    border: inherit;
    background: inherit;
}
.alert.hover::before {
    display: inline-block;
}








[data-tooltip] {
    position: relative; /* Относительное позиционирование */ 
}
[data-tooltip]::after {
    content: attr(data-tooltip); /* Выводим текст */
    position: absolute; /* Абсолютное позиционирование */
    width: 300px; /* Ширина подсказки */
    left: 0; top: 0; /* Положение подсказки */
    background: #3989c9; /* Синий цвет фона */
    color: #fff; /* Цвет текста */
    padding: 0.5em; /* Поля вокруг текста */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* Параметры тени */
    pointer-events: none; /* Подсказка */
    opacity: 0; /* Подсказка невидима */
    transition: 1s; /* Время появления подсказки */
} 
[data-tooltip]:hover::after, [data-tooltip]:focus::after, [data-tooltip]:active::after {
    opacity: 1; /* Показываем подсказку */
    top: 2em; /* Положение подсказки */
}


