- Página Inicial
- Códigos CSS Prontos
- Efeito hover css – zoom Out
- Voltar
efeito hover css – zoom Out
Neste tutorial veja como podemos criar um efeito hover css – zoom Out com html e css Responsivo.
Nesta seção, projetaremos uma estrutura simples na tag <article>, <div>, <img>, <h2>,<p> e a <href>para inserir o link de destino.
Usaremos as classes (.box-article, .box, .frame e a class .zoom-out) para dar o formato e estilizar com css.
Essas é a tags e classes que usaremos para criar o nosso hoverlay com html e Css
Vamos Adicionar o HTML
<article class="box-article"> <div class="box zoom-out" > <img src="uploads/foto.jpg" alt="Front-end"> <div class="frame"> <h2>Front-end</h2> <p><a href="#" title="Developer">DEVELOPER</a></p> </div> </div> </article>
Vamos Adicionar o CSS
Nesta seção, usaremos algumas propriedades CSS para estilizar e animar o nosso Efeito hover css – zoom Out
com html e css.
.box-article { max-width: 420px; width: 100%; height: 100%; margin: auto; box-shadow: 1px 0px 1.2px 0px #e3e3e3; } .box { position: relative; max-height: 300px; border-radius: 4px; overflow: hidden; box-shadow: 0 1.4px 1.7px rgba(0, 0, 0, 0.017), 0 3.3px 4px rgba(0, 0, 0, 0.024), 0 6.3px 7.5px rgba(0, 0, 0, 0.03), 0 11.2px 13.4px rgba(0, 0, 0, 0.036), 0 20.9px 25.1px rgba(0, 0, 0, 0.043), 0 50px 60px rgba(0, 0, 0, 0.06); } .box .frame { position: absolute; border: 2px solid #fff; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); } .box h2, .box p { position: absolute; color: #fff; z-index: 2; width: 100%; transition: opacity 0.2s, transform 0.3s; } .box h2 { font-weight: 500; font-size: 22px; margin-bottom: 0; letter-spacing: 1px; } .box p { bottom: 0; font-size: 14px; letter-spacing: 1px; } .box:hover { transition: all 0.3s ease-in-out; } .box:hover:before { transition: all 0.3s ease-in-out; } .box img { position: relative; width: 100%; height: 100%; z-index: 1; transition: all 0.3s ease-in-out; } .box img:hover { transition: all 0.3s ease-in-out; } .box img:after { content: ""; position: absolute; background-color: rgba(0, 0, 0, 0.6); width: 100%; height: 100%; top: 0; left: 0; opacity: 0; } .box img:hover { transition: all 0.3s ease-in-out; } .zoom-out .frame { width: calc(100% - 40px); height: calc(100% - 40px); opacity: 0; transition: all 0.3s ease-in-out; } .zoom-out h2, .zoom-out p { text-align: center; top: 50%; transform: translatey(-50%); margin: 0; z-index: 3; } .zoom-out h2 { letter-spacing: 10px; } .zoom-out p { transform: translatey(30px); letter-spacing: 4px; } .zoom-out p a { text-decoration: none; color: #00b4fa; font-size: 16px; font-weight: bold; } .zoom-out p a:hover { text-decoration: underline; } .zoom-out:before { content: ""; position: absolute; width: 100%; height: 100%; background: #000; z-index: 1; left: 0; opacity: 0; transition: all 0.3s ease-in-out; } .zoom-out img { z-index: 2; } .zoom-out:hover .frame { width: calc(100% - 80px); height: calc(100% - 80px); opacity: 1; } .zoom-out:hover img { opacity: 0.3; } .zoom-out:hover:before { opacity: 1; transition: all 0.3s ease-in-out; }
Combinando as Duas seções acima Html e Css temos o seguinte Resultado!
Veja o Resultado baixo!
Baixar Código Veja Funcionando
Publicado por: Loop Nerd
100 Visualizações
Deixe um comentário