span title效果设置_视频遮罩效果

html代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>过渡</title>
</head>
<body>
<ul>
<li>
<div class="box-img">
<img src="王者荣耀官网首页制作/img/img02.jpg" alt="">
<div class="mask">
<div class="mask-txt">
<span>3.4万</span>
<span>2018-06-29</span>
</div>
<div class="mask-icon"></div>
</div>
</div>
<p class="box-txt">
【GK来了】套路究竟有多深?GK.可乐带你解析鬼谷子
</p>
</li>
</ul>
</body>
</html>

css代码:

<style>
ul{
list-style: none;
}
li{
width:209px;
height:205px;
float: left;/*background-color: darksalmon;*/
cursor: pointer;
}
li:hover .mask{
top:0;
}
li:hover .mask-txt{
opacity: 0;/*display: none;*/
}
.box-img{
width:209px;
height:126px;
position: relative;
background-color: #fdc04d;
overflow: hidden; /*内容溢出*/
border-bottom: 1px solid #5f6565;
}
.box-img>img{
display: block;
width: 100%;
height: 100%;
}
.mask{
width:209px;
height:126px;
background: rgba(0,0,0,0.7);
position: absolute;
top:105px;
left:0;
transition: all 0.6s ease;
}
.mask-txt{
height:21px;
}
.mask-txt>span{
display:block;
height: 21px;
line-height: 21px;
color: #fff;
font-size:12px;
}
.mask-txt>span:first-child{
padding-left:14px;
float: left;
margin-left:10px;
background: url("王者荣耀官网首页制作/img/index.png") no-repeat -256px -60px;
}
.mask-txt>span:last-child{
float: right;
margin-right: 10px;
}
.mask-icon{
width:40px;
height:40px;
margin:22px auto 0;
background: url("王者荣耀官网首页制作/img/index.png") no-repeat -192px -64px;
}
.box-txt{
font-size: 12px;
line-height: 22px;
margin-top: 10px;
}
</style>

实现效果如下:

184a3365a1726d4f56b66726cf98f69c.png
https://www.zhihu.com/video/1231659007577604096
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值