transitonによるアニメーション
<html>
<head>
<meta charset="utf-8">
<title>transitonによるアニメーション</title>
<style>
html, body, div, h1, h2, h3, h4, h5, h6,p, blockquote, pre,
address,ul, ol, li, dl, dt, dd,table, th, td, form, fieldset {
margin: 0;
padding: 0;
line-height: 1.0;
font-family:
"Hiragino Kaku Gothic ProN",
Meiryo,
sans-serif;
}
ul {
list-style: none;
}
a {
text-decoration: none;
}
img {
border: 0;
vertical-align: bottom;
}
.box {
width: 500px;
height:300px;
background: #06F;
position:relative;
overflow: hidden;
}
.cap {
padding-top: 40%;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
z-index: 10;
background: rgba(245,44,67,0);
cursor: default;
transition: ease 0.3s;
}
.cap:hover {
top:-40%;
left: 0;
background: rgba(245,44,67,1);
}
h3{
padding-bottom: 20px;
color: #FFF;
font-size: 22px;
}
.text {
color: #FFF;
font-size: 16px;
margin-bottom: 50px;
}
.view {
width: 40%;
margin: 0 auto;
font-size: 20px;
color: #FFF;
padding: 10px;
border: 1px solid #FFF;
transition: 0.2s ease-in-out;
}
.view:hover{
background:white;
color: #111;
cursor: pointer;
}
</style>
</head>
<body>
<div class="box">
<a href="#">
<div class="cap">
<h3>ページタイトル</h3>
<p class="text">ページの説明文、テキストテキストテキスト</p>
<p class="view">view more</p>
</div>
</a>
</div>
</body>
</html>