css悬浮展示隐藏内容,从下向上展示

标题
    <div class="cont">
        <div class="box">
            <img src="./images/1.jpg" alt="">
            <p class="title">无锡2日1晚自由行(5钻)·【5.23-5.25抢购】</p>
            <div>
                <p class="txt_a">
                    席位充足
                </p>
                <p class="price">
                    <sup>¥</sup><span class="price_num">350</span>起
                </p>
            </div>
            <div class="label_img">
                特卖
            </div>
          
            <div class="img_txt">
                只卖3天,套餐卖价格等于外网一间房间的价格
                <div>标题:动态效果</div>
                <div>内容:悬浮时底部向上动态展示内容</div>
            </div>
        </div>
    </div>

 

*{
    margin: 0px;
    padding: 0px;
}

.cont{
    width: 917px;
    height: 343px;
}
.box{
    width: 220px;
    height: 158px;
    color: #666666;
    float: left;
    margin: 5px 5px 12px 2px;
    position: relative;
}
img{
    width: 220px;
    height: 110px;
}
.title{
    font-size: 11px;
    height: 27px;
    line-height: 27px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.txt_a{
    float: left;
    font-size: 11px;
    color: #c2a5b2;
}
.price{
    float:right;
    font-size: 9px;
    vertical-align: super;
}
.price_num{
    font-size: 16px;
    color: red;
    font-weight: bold;
}
.label_img{
    width: 39px;
    height: 25px;
    font-size: 11px;
    background-image: url(../images/un_sprite_tag.png);
    background-repeat: no-repeat;
    position: absolute;
    top: 0px;
    left: 12px;
    text-align: center;
    color: white;
    line-height: 25px;
}
//悬浮展示样式
.img_txt{
    width: 216px;
    height: 25px;
    font-size: 11px;
    line-height: 25px;
    background-color: rgba(0, 0, 0, 0.308);
    position: absolute;
    top: 85px;
    color: white;
    overflow: hidden;
    padding-left: 4px;
    transition: 1s;
}
.box:hover .img_txt{
    height: 110px;
    top: 0px;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值