61,115
社区成员
发帖
与我相关
我的任务
分享
box:hover img
tansition
都错了<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS半透明效果</title>
<style type="text/css">
body {
background:#CCC;
}
.main {
width:980px;
margin:0px auto;
border-radius:12px;
box-shadow:4px 4px 3px #30F, -4px -4px 5px #F03;
padding:20px;
}
.box {
width:200px;
height:300px;
background:#0F0;
border-radius:10px;
border:5px solid #309;
position:relative;
overflow:hidden;
}
.box .scale {
position:absolute;
top:0px;
left:0px;
width:200px;
height:300px;
color:#FFF;
background:rgba(0, 0, 0, 0.0);
transition:all 400ms;
}
.box .scale h3 {
width:180px;
font-size:18px;
margin:10px;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
left:-200px;
position:absolute;
font-size:18px;
}
.box .scale p {
width:180px;
font-size:12px;
margin:10px;
text-indent:2en;
line-height:20px;
left:-200px;
position:absolute;
top:40px;
}
.box .scale i {
position:absolute;
bottom:0px;
}
.box:hover img {
transform:scale(1.5);
transition:all 900ms ease;
}
.box:hover .scale {
background:rgba(0, 0, 0, 0.5);
}
.box .scale h3 {
transform:translateX(200px);
transition:all 400ms ease-out;
}
.box .scale p {
transform:translateX(200px);
transition:all 900ms ease-out;
}</style>
</head>
<body>
</body>
<div class="main">
<div class="box">
<img src="tp/1.jpg" width="200" height="300" alt="美丽的传说你的白马王子"/>
<div class="scale">
<h3>2015夏季新装时尚上市 秋装也即将登台 敬请期待哦也</h3>
<p>2015夏季新装时尚上市 秋装也即将登台 敬请期待哦也</p>
<i>2015-10-10</i>
</div>
</div>
</div>
</html>