css效果,在一个盒子里,把一部分内容隐藏掉,在鼠标悬停到div时,就会把隐藏的部分向上显示出来。 不用js操作,纯css就可以。

html部分:
<li class="featureBox">
<div class="bigbox">
<a href="#"><img src="${imgUrl}" width="300px" height="250px" />
<div class="titlebox">
<i></i>   
<div class="titleboxtext">
<h3>显示出来的部分</h3>
<p>隐藏的部分,在一个盒子里,把一部分内容隐藏掉,在鼠标悬停到div时,就会把隐藏的部分向上显示出来。</p>
</div>
</div>
</a>
</div>

</li>
css部分:
.featureBox{
width:300px;
color: #eee;
font-size: 14px;
line-height: 23px;
text-align: center;
overflow: visible;
    background-repeat: no-repeat;
    border-style: dotted;
    float:right; 
    margin-right:15px;
}
.featureBox a{
position: relative;
}
.bigbox{
overflow: hidden;
}
.titlebox{
bottom: 4px;
width: 280px;
height: 27px;
left: 0;
line-height: 27px;
overflow: hidden;
padding: 0px 10px 0;
position: absolute;
transition: all 0.4s ease 0s;
}
.titlebox i{
background: #000 none repeat scroll 0 0;
height: 73px;
left: 0;
opacity: 0.7;
position: absolute;
top: 0;
width: 300px;
z-index: 1;
}
.titleboxtext{
color: #eee;
font-size: 12px;
line-height: 21px;
position: absolute;
text-align: left;
z-index: 100;
}
.titleboxtext h3{
color: #eee;
font-size: 14px;
line-height: 23px;
text-align: center
}
 .bigbox:hover .titlebox{
height:70px;
transition:all .4s;-moz-transition: all .4s;-webkit-transition: all .4s;-o-transition: all .4s
}
.article-list li .bigbox a{
POSITION: relative
}
  • 4
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值