css3 旋转 过渡 实例

鼠标经过时两张图片过渡旋转替换

<!DOCTYPE html>
<html lang="kz">
<head>
    <meta charset="UTF-8">
    <title>css3D旋转</title>
    <style>
        .content{
            height: 300px;
            width: 300px;
            margin:0 auto;
            position: relative;
        }
  .img1,.img2 {
      height: 300px;
      width: 300px;
      display: block;
     border-radius: 50%;
      position: absolute;
      top: 0;
      left: 0;
      transition: transform 1s;
      backface-visibility: hidden;
  }
        .img2{
            background: url(images/bg05.jpg) no-repeat;
            transform:rotateY(-180deg);
        }
        .img1{
            background: url(images/bg03.jpg) no-repeat;
            z-index:1;
        }
     .content:hover  .img1{
         transform:rotateY(-180deg);
     }
        .content:hover  .img2{
            transform:rotateY(0deg);
        }
 </style>
</head>
<body>
<div class="content">
    <div class="img1"></div>
    <div class="img2"></div>
</div>
</body>
</html>
posted @ 2015-09-28 23:12  aytsoft  阅读(526)  评论(0编辑  收藏  举报