Carregando...

Efeito hover css – zoomOut

Postado: 16 de fevereiro de 2023 Tempo de Leitura: 2 Minutos

Efeito hover css – zoomOut img

Neste tutorial veja como podemos criar um efeito hover css – zoomOut img 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. 

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>LOOP NERD <span>FRONT-END</span></h2>
                      <p>Códigos html e css prontos para usar.<br> <a href="#" title="Códigos html e css prontos">Veja mais</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 – zoomOut img com html e css.

.box-article {
 
  max-width: 420px;
  width: 100%;
  height: 100%;
  padding: 10px;
  margin: auto;

}

.box {
 
  position: relative;
  max-height: 300px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 1px 0px 1.2px 0px #e3e3e3;

}

.box .frame {
 
  position: absolute;
  border: 1px 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% - 100px);
  height: calc(100% - 100px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px);
  height: calc(100% - 40px);

}

.zoom-out h2 {

  font-size: 20px;
  font-weight: bold;
  margin-left: 15px;
  margin-top: 10px;
  letter-spacing: 2px;

}

.zoom-out span {

  font-size: 20px;
  font-weight: normal;

}

.zoom-out p {

  max-width: 150px;
  text-align: right;
  margin: 15px;
  right: 0;

}

.zoom-out p a { 

    color: #ffbf00;
    text-decoration: underline;
    font-weight: bold; 

}

.zoom-out img {

  transform: scale(1.2);

}

.zoom-out:hover img {

  transform: scale(1);
  filter: contrast(70%);

}

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

210 Visualizações

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Artigos Relacionados