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;
}

相关推荐

  1. 横向滚动展示内容

    2023-12-10 09:40:07       18 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-10 09:40:07       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-10 09:40:07       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-10 09:40:07       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-10 09:40:07       18 阅读

热门阅读

  1. TimescaleDB-1 安装

    2023-12-10 09:40:07       52 阅读
  2. 力扣1004题 最大连续1的个数 III 滑动窗口

    2023-12-10 09:40:07       33 阅读
  3. Doris Hive外表

    2023-12-10 09:40:07       37 阅读
  4. 逻辑卷LVM

    2023-12-10 09:40:07       35 阅读
  5. ElasticSearch之cat plugins API

    2023-12-10 09:40:07       43 阅读
  6. redhat7.5+selenium+firefox+geckodriver离线部署总结

    2023-12-10 09:40:07       42 阅读
  7. jupyter notebook搭建

    2023-12-10 09:40:07       37 阅读
  8. 获取页面标签元素dom的方法

    2023-12-10 09:40:07       38 阅读
  9. 十年婚姻·总结七

    2023-12-10 09:40:07       32 阅读
  10. [动态规划]矩阵取数游戏

    2023-12-10 09:40:07       29 阅读
  11. 无人机风速风向仪-百科小天地

    2023-12-10 09:40:07       38 阅读
  12. Matlab: 输入解析器验证函数

    2023-12-10 09:40:07       34 阅读
  13. (C)一些题11

    2023-12-10 09:40:07       36 阅读