
Подробное описание и демонстрацией работы эффекта наведения под номером №172 для бибилиотеки Bootstrap. Html и CSS код для реализации hover effect как на изображении.
html разметка для реализации данного эффекта<div class="container"> <div class="row"> <div class="col-md-4 col-sm-6"> <div class="box"> <img src="https://fokit.ru/demo/images/hover-effect/hover-effect-style-172/img-1.jpg" alt=""/> <div class="box-content"> <h3 class="title">Williamson</h3> <span class="post">Web Developer</span> <ul class="icon"> <li><a href="#" class="fa fa-search"></a></li> <li><a href="#" class="fa fa-link"></a></li> </ul> </div> </div> </div> <div class="col-md-4 col-sm-6"> <div class="box"> <img src="https://fokit.ru/demo/images/hover-effect/hover-effect-style-172/img-2.jpg" alt=""/> <div class="box-content"> <h3 class="title">Kristiana</h3> <span class="post">Web Designer</span> <ul class="icon"> <li><a href="#" class="fa fa-search"></a></li> <li><a href="#" class="fa fa-link"></a></li> </ul> </div> </div> </div> </div> </div>css разметка для реализации данного эффекта
.box{ overflow: hidden; box-shadow: 0 0 3px rgba(0,0,0,0.3); position: relative; } .box img{ width: 100%; height: auto; } .box .box-content{ padding: 25% 5%; position: absolute; top: 0; left: 0; bottom: 0; right: 0; text-align: center; opacity: 0; z-index: 1; transition: all 0.3s ease 0s; } .box:hover .box-content{ opacity: 1; } .box:before, .box:after, .box .box-content:before, .box .box-content:after{ content: ""; width: 50%; height: 50%; background: rgba(0,0,0,0.8); position: absolute; top: 0; left: 0; opacity: 0; transition: all 0.5s ease 0s; } .box:after{ top: 50%; } .box .box-content:before, .box .box-content:after{ top: 0; left: 50%; z-index: -1; } .box .box-content:after{ top: 50%; } .box:hover:before{ left: 50%; opacity: 1; } .box:hover:after{ top: 0; opacity: 1; } .box:hover .box-content:before{ top: 50%; opacity: 1; } .box:hover .box-content:after{ left: 0; opacity: 1; } .box .title{ font-size: 26px; font-style: italic; color: #ffd700; text-transform: uppercase; margin: 0 0 10px 0; } .box .post{ display: block; font-size: 14px; font-weight: 700; color: #fff; margin: 0 0 20px 0; } .box .icon{ padding: 0; margin: 0; list-style: none; } .box .icon li{ display: inline-block; margin: 0 5px 0 0; } .box .icon a{ display: block; width: 30px; height: 30px; line-height: 30px; border-radius: 15%; background: #fff; font-size: 15px; color: #2d2c2c; text-align: center; transition: all 0.3s ease 0s; } .box .icon a:hover{ background: transparent; color: #fff; border-radius: 50%; box-shadow: 1px 1px 3px #fff, -1px -1px 3px #fff; } @media only screen and (max-width:990px){ .box{ margin-bottom: 30px; } }