
Подробное описание и демонстрацией работы эффекта наведения под номером №108 для бибилиотеки Bootstrap. Html и CSS код для реализации hover effect как на изображении.
Демонстрация эффекта наведения — стиль 108
<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-108/img-1.jpg" alt=""/> <div class="box-layer"> <div class="box-icon"><i class="fa fa-crosshairs"></i></div> <div class="border-outer"> <div class="box-inner top"></div> <div class="box-inner right"></div> <div class="box-inner bottom"></div> <div class="box-inner left"></div> </div> <div class="border-inner"> <div class="box-inner top"></div> <div class="box-inner right"></div> <div class="box-inner bottom"></div> <div class="box-inner left"></div> </div> </div> <div class="box-content"> <h4 class="title">Williamson</h4> <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ac consectetur magna, at malesuada nunc. Sed.</p> <a href="#" class="read-more">read more</a> </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-108/img-2.jpg" alt=""/> <div class="box-layer"> <div class="box-icon"><i class="fa fa-crosshairs"></i></div> <div class="border-outer"> <div class="box-inner top"></div> <div class="box-inner right"></div> <div class="box-inner bottom"></div> <div class="box-inner left"></div> </div> <div class="border-inner"> <div class="box-inner top"></div> <div class="box-inner right"></div> <div class="box-inner bottom"></div> <div class="box-inner left"></div> </div> </div> <div class="box-content"> <h4 class="title">Kristiana</h4> <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ac consectetur magna, at malesuada nunc. Sed.</p> <a href="#" class="read-more">read more</a> </div> </div> </div> </div> </div>css разметка для реализации данного эффекта
.box{ overflow: hidden; position: relative; } .box img{ width: 100%; height: auto; } .box .box-layer{ width: 60px; height: 60px; line-height: 60px; background: rgba(255,255,255,0.7); text-align: center; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; transition: all 0.2s linear 0s; } .box:hover .box-layer{ width: 100%; height: 100%; top: 0; left: 0; } .box .box-icon{ font-size: 30px; color: #383636; opacity: 1; transition: all 0.01s linear 0.2s; } .box:hover .box-icon{ opacity: 0; transition-delay: 0s; } .box .border-outer{ width: 90%; height: 90%; position: absolute; top: 5%; left: 5%; opacity: 0; transition: all 0.01s linear 0s; } .box .box-inner{ background: #383636; position: absolute; transition: all 0.3s linear 0s; } .box .border-outer .top{ top: 0; left: 0; width: 0; height: 2px; } .box .border-outer .left{ top: 0; left: 0; width: 2px; height: 0; } .box .border-outer .bottom{ bottom: 0; right: 0; width: 0; height: 2px; } .box .border-outer .right{ bottom: 0; right: 0; width: 2px; height: 0; } .box .border-inner{ width: 88%; height: 88%; position: absolute; top: 6%; left: 6%; opacity: 0; transition: all 0.01s linear 0s; } .box .border-inner .top{ top: 0; right: 0; width: 0; height: 2px; } .box .border-inner .left{ bottom: 0; left: 0; width: 2px; height: 0; } .box .border-inner .bottom{ bottom: 0; left: 0; width: 0; height: 2px; } .box .border-inner .right{ top: 0; right: 0; width: 2px; height: 0; } .box:hover .top, .box:hover .bottom{ width: 100%; transition-delay: 0.2s; } .box:hover .left, .box:hover .right{ height: 100%; transition-delay: 0.2s; } .box .box-content{ width: 100%; height: 100%; text-align: center; color: #fff; position: absolute; top: 0; left: 0; } .box .title{ width: 80%; padding: 6px 0; margin: 21% auto 0; background: rgba(0,0,0,0.8); font-size: 22px; font-weight: 400; text-transform: uppercase; position: relative; opacity: 0; transition: all 0.2s linear 0s; } .box:hover .title{ transition-delay: 0.75s; } .box .title:before{ content: ""; display: block; border: 20px solid transparent; border-top: 20px solid rgba(0,0,0,0.8); position: absolute; top: 100%; left: 42%; } .box .description{ width: 80%; font-size: 14px; font-weight: 400; background: rgba(0,0,0,0.8); padding: 6px 10px; margin: 40px auto 0; opacity: 0; transition: all 0.2s linear 0s; } .box:hover .description{ transition-delay: 0.65s; } .box .read-more{ display: inline-block; font-size: 15px; color: #fff; text-transform: capitalize; padding: 7px 20px; margin: 30px auto 0; background: #1b667f; border-radius: 5px; box-shadow: inset 0 0 7px 1px rgba(0,0,0,0.2); opacity: 0; transition: all 0.2s linear 0s; } .box:hover .read-more{ transition-delay: 0.55s; } .box:hover .border-outer, .box:hover .border-inner, .box:hover .title, .box:hover .description, .box:hover .read-more{ opacity: 1; } @media only screen and (max-width: 990px){ .box{ margin-bottom: 30px; } } @media only screen and (max-width: 479px){ .box .title{ margin-top: 12%; } .box .description{ margin-top: 20px; } .box .border-outer{ width: 92%; height: 92%; top: 4%; left: 4%; } .box .title:before{ border: 10px solid transparent; border-top: 10px solid rgba(0,0,0,0.8); } }