css3 鼠标滑过图片时文字旋转动画

特效描述:鼠标滑过图片的时候,以左上角为原点,顺时针旋转90度出现黑色遮罩层,之后文字一行行以右上角为原点旋转180度出现,纯css3实现,拷贝下面代码保存为html文件就可以查看效果。(所用到的图片可以用本地的图片代替)

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>炫酷C</title>

<style type="text/css">
.box{
   border: 1px solid #333;
   position: relative;
   overflow: hidden;
   width:300px;
   float: left;
   margin-right: 20px;
}
.box img{
   width:100%;
   height: auto;
}
.box .box-content{
   width: 100%;
   height: 100%;
   position: absolute;
   top: 0;
   left: 0;
   color: #fff;
   text-align: center;
   padding: 20% 20px;
   background: rgba(0,0,0,0.6);
transform:rotate(-90deg);
transform-origin:left top 0;
transition:all 0.5s ease 0s;
}
.box .title{
   display: inline-block;
   font-size: 22px;
   color: #fff;
   margin: 0 0 15px 0;
   position: relative;
   transform: rotate(180deg);
   transform-origin: right top 0;
   transition: all .3s ease-in-out 0.2s;
}
.box .post{
   display: block;
   font-size: 18px;
   margin-bottom: 15px;
   transform: rotate(180deg);
   transform-origin: right top 0;
   transition: all .3s ease-in-out 0.4s;
}
.box .description{
   font-size: 15px;
   margin-bottom: 20px;
   padding: 0 20px;
   transform: rotate(180deg);
   transform-origin: right top 0;
   transition: all .3s ease-in-out 0.6s;
}
.box .read{
   font-size: 20px;
   font-weight: bold;
   color: #fff;
   display: block;
   letter-spacing:2px;
   text-transform: uppercase;
   transform: rotate(180deg);
   transform-origin: right top 0;
   transition: all 0.3s ease-in-out 0.8s;
}
.box .read:hover{
   color: #e8802e;
   text-decoration: none;
}
.box:hover .box-content,
.box:hover .title,
.box:hover .post,
.box:hover .description,
.box:hover .read {
   transform:rotate(0deg);
}

</style>
<!--[if IE]>
<script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>

<div class="demo">
    <div class="box">
        <img src="img/1.jpg" alt=""/>
        <div class="box-content">
            <h3 class="title">Kristiana</h3>
            <span class="post">Earl Grey</span>
            <p class="description">
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque facilisis augue eget ligula tristique viverra.
            </p>
            <a href="#" class="read">read more</a>
        </div>
</div>
    <div class="box">
        <img src="img/2.jpg" alt=""/>
        <div class="box-content">
            <h3 class="title">Williamson</h3>
            <span class="post">West Cowboy</span>
            <p class="description">
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque facilisis augue eget ligula tristique viverra.
            </p>
            <a href="#" class="read">read more</a>
        </div>
    </div> 
</div>
</body>
</html>


  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值