特效描述:鼠标滑过图片的时候,以左上角为原点,顺时针旋转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>