Подробное описание и демонстрация работы эффекта наведения для ссылки под номером №4 для библиотеки Bootstrap. Html и CSS код для оформления ссылок на сайте как на изображении.

HTML разметка и CSS стили для оформления ссылок на сайте
<a href="#" data-attr="hover me" class="link"><span>hover me</span></a>
.link{
    display: inline-block;
    overflow: hidden;
    position: relative;
}
.link:before{
    content: attr(data-attr);
    width: 100%;
    height: 2px;
    background: #654fa1;
    font-size: 20px;
    color: #fff;
    text-transform: uppercase;
    text-align: center;
    overflow: hidden;
    position: absolute;
    top: 95%;
    left: 0;
    transition: height 0.2s ease 0s, top 0.1s ease 0.2s;
}
.link:hover:before{
    height: 100%;
    top: 0;
    transition: top 0.2s ease 0s, height 0.5s ease 0.3s;
}
.link > span{
    display: block;
    padding: 0 5px;
    font-size: 20px;
    color: #654fa1;
    text-transform: uppercase;
    z-index: 1;
}
@media only screen and (max-width: 767px){
    .link{ margin-bottom: 20px; }
}


Теги:
0

Оставить своё мнение

Ваш e-mail не будет опубликован. Обязательные поля помечены *