鼠标悬浮图片3D翻转出现文本说明

#鼠标悬浮图片3D翻转出现文本说明

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<style>
html, body, div, h2, p {
  margin: 0;
  padding: 0;
}
.wrap {
  width: 200px;
  height: 200px;
  border-radius: 200px;
  overflow: hidden;
  margin: 200px auto;
}
.img {
  background: url("demo/CSS/img/shishi.jpg") center;
  background-size: 200px;
}
.shadow {
  width: 160px;
  height: 160px;
  border-radius: 160px;
  background: #fff;
  margin: 20px;
  box-shadow: 0 0 0 20px rgba(255,255,255,.4);
  transition: box-shadow 0.5s ease-in-out;
}
.photo {
  width: 160px;
  height: 160px;
  position: relative;
}
.front, .back {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 160px;
  overflow: hidden;
  transform-style: preverve-3d;
  backface-visibility: hidden;
  transition: transform 0.5s ease-in-out;
}
.back {
  background: #ff0b40;
  text-align: center;
  color: #fff;
}
.back h2 {
  font-size: 22px;
  padding: 25px 0 35px 0;
  margin: 0 15px;
  border-bottom: 1px solid #fff;
}
.back p {
  font-size: 15px;
  margin-top: 10px;
}
.wrap .front {
  transform: rotateY(0deg);
}
.wrap .back {
  transform: rotateY(180deg);
}
.wrap:hover .front {
  transform: rotateY(180deg);
}
.wrap:hover .back {
  transform: rotateY(0deg);
}
.wrap:hover .shadow {
  box-shadow: 0 0 0 0 rgba(255,255,255,.4);
}
</style>
</head>
<body>
  <div class="wrap img">
    <div class="shadow">
      <div class="photo">
        <div class="front img"></div>
        <div class="back">
          <h2>刘诗诗</h2>
          <p>
            1978-03-10<br />
            双鱼座
          </p>
        </div>
      </div>
    </div>
  </div>
</body>
</html>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值