CSS3综合实例三(仿天猫专题栏过渡效果)

仿天猫专题栏过渡效果

实例需求

  • 鼠标移入商品栏时,增加透明度
  • 鼠标移入商品栏时,商品主图向左偏移几许,缓缓过渡

实例详情

<!DOCTYPE html>
<html>
  <head>
    <title>仿天猫专题过渡效果</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width initial-scale=1.0"/>
    <link rel="stylesheet" href="./pattern.css"/>
  </head>
  <body>
    <div class="container">
      <div class="goodsPic">
        <img src="./brush.jpg" alt="brush"/>
      </div>
      <div class="content">
        Philips/飞利浦充电式成人声波钻石电动牙刷HX9352/HX9332/HX9362
      </div>
      <div class="goodsPri">
        <span class="change">¥299</span>&nbsp
        <span class="origin">¥1299</span>
      </div>
    </div>
  </body>
</html>
* {
  margin:0px;
  padding:0px;
}
body {
  background-color:#f5f5f5;
}
.container {
  box-sizing:border-box;
  width:200px;
  height:265px;
  background-color:#fff;
  margin:60px auto;
  text-align:center;
}
.goodsPic img {
  position:relative;
  left:0px;
  margin-top:20px;
  width:160px;
  height:160px;
  transition: all 0.8s;
}
.container:hover img {
  left:-8px;
  opacity:0.5;
}
.content {
  height:20px;
  overflow:hidden;
  margin:10px 8px 8px 8px;
}
.goodsPri .change {
  font-size:20px;
  color:#f00;
}
.origin {
  color:#666;
  text-decoration:line-through;
}

效果
zonghe3.gif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值