码迷,mamicode.com
首页 > Web开发 > 详细

css3skew

时间:2018-04-07 17:36:21      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:add   padding   class   image   meta   NPU   height   html   font   

代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select,figure,figcaption{margin:0;padding:0}
body{font:14px"微软雅黑","Arial Narrow",HELVETICA;}
figure{
float: left;
width: 33%;
overflow: hidden;
position: relative;
background: #2f0000;
}
figure img{
height: 400px;
opacity: 0.9;
transition: all 0.35s;
}
figcaption{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
figcaption h3{
color: #ffffff;
margin: 10% 0 0 12%;
transition: all 1s;
transform: skew(90deg);
}
figcaption p{
background:#ffffff;
color: #000000;
margin:15px;
font-size: 13px;
text-align: center;
width: 130px;
height: 20px;
line-height: 20px;
transition: all 1s;
transform: skew(90deg);
}

figure:hover figcaption h3{
transform: skew(0deg);
}
figure:hover figcaption p{
transform: skew(0deg);
}
</style>
</head>
<body>

<figure>
<img src="images/2.jpg">
<figcaption>
<h3>标题标题</h3>
<p>文字文字文字文字</p>
</figcaption>
</figure>
<figure>
<img src="images/3.jpg">
<figcaption>
<h3>标题标题</h3>
<p>文字文字文字文字</p>
</figcaption>
</figure>
</body>
</html>

css3skew

标签:add   padding   class   image   meta   NPU   height   html   font   

原文地址:https://www.cnblogs.com/yuanyuan-1994/p/8733464.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!