图片悬停弹出文字效果

代码语言:html

所属分类:悬停

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<title> - THUMBNAIL HOVER EFFECTS</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<style>
    @import url(https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900);
.grid-wrap {
  padding: 1%;
}

.list-block {
  float: left;
  margin: 1%;
  width: 31.33333%;
  font-size: 0;
  overflow: hidden;
}
.list-block figure {
  position: relative;
  display: block;
  color: black;
  text-align: center;
}
.list-block figure:after {
  background: #fff;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  bottom: 0;
  content: '';
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
  opacity: 0.7;
  -webkit-transform: skew(-45deg) scaleX(0);
  -ms-transform: skew(-45deg) scaleX(0);
  transform: skew(-45deg) scaleX(0);
  -moz-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  -webkit-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}
.list-block figure:hover:after {
  -webkit-transform: skew(-45deg) scaleX(1);
  -ms-transform: skew(-45deg) scaleX(1);
  transform: skew(-45deg) scaleX(1);
  -moz-transition: all 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -o-transition: all 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-transition: all 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.list-block figure:hover figcaption h2,
.list-block figure:hover figcaption p {
  -moz-transform: translate3d(0%, 0%, 0);
  -webkit-transform: translate3d(0%, 0%, 0);
  transform: translate3d(0%, 0%, 0);
  -webkit-transition-delay: 0.2s;
  transition-delay: 0.2s;
}
.list-block figure:hover figcaption h2 {
  filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
  opacity: 1;
}
.list-block figure:hover figcaption p {
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
  opacity: 0.7;
}
.list-block img {
  filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
  opacity: 1;
  max-width: 100%;
  min-width: 100%;
  -moz-transition: opacity 0.35s ease;
  -o-transition: opacity 0.35s ease;
  -webkit-transition: opacity 0.35s ease;
  transition: opacity 0.35s ease;
}
.list-block figcaption {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  z-index: 1;
}
.list-block h2,
.list-block p {
  margin: 0;
  width: 100%;
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
  opacity: 0;
}
.list-block h2 {
  padding: 0 30px 10px;
  display: inline-block;
  font-weight: 400;
  text-transform: uppercase;
  font-size: 24px;
}
.list-block p {
  padding: 0 50px;
  font-size: 14px;
  text-transform: uppercase;
}

.demo-2 figure figcaption p {
  margin-top: -45px;
}
.demo-2 figure:after {
  -webkit-transform: skew(-45deg) scaleX(0);
  -ms-transform: skew(-45deg) scaleX(0);
  transform: skew(-45deg) scaleX(0);
}
.demo-2 figure:hover:after {
  -webkit-transform:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0