CSS3标题加数据展示效果实例

2456
0

前端小姐姐 小试身手Lv3

发表于2021-8-26 18:28

楼主
1、页面效果:


2、这个效果可以运用在自定义大屏中,对重要数据去展示。下边来简单介绍下具体实现代码,主要用到了常规的html、css,代码如下:
html:
<div class="main">
    <div class="title title1">
        <div class="text">
            <h6>预算金额</h6>
            <p>26.85亿元</p>
        </div>
        <div class="line"></div>
    </div>
    <div class="title title2">
        <div class="text">
            <h6>实际金额</h6>
            <p>22.96亿元</p>
        </div>
        <div class="line"></div>
    </div>
    <div class="title title3">
        <div class="text">
            <h6>预算完成率</h6>
            <p>85.51%</p>
        </div>
        <div class="line"></div>
    </div>
    <div class="title title4">
        <div class="text">
            <h6>资产利润率</h6>
            <p>73.10%</p>
        </div>
        <div class="line"></div>
    </div>
    <div class="title title5">
        <div class="text">
            <h6>成本收入比</h6>
            <p>40.50%</p>
        </div>
        <div class="line"></div>
    </div>
</div>
css:<style>
    *{
        padding: 0;
        margin: 0;
    }
    body{
        width: 100%;
        height: 100vh;
        background-image: url(img/bg1.jpg);
        background-position: center;
        background-color: #122432;
        background-repeat: no-repeat;
        position: relative;
    }
    body:before{
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        background: rgba(0,0,0,.13);
    }
    .main{
        position: absolute;
        left: 50%;
        top: 50%;
        margin: -347px 0 0 -547px;
        z-index: 2;
        width: 1095px;
        height: 694px;

    }

    .title{
        position: absolute;
        left: 95px;
        bottom: 303px;
        width: 204px;
        height: auto;
        overflow: hidden;
        padding-bottom: 20px;
    }
    .title .text{
        width: 164px;
        height: 55px;
        padding: 30px 20px;
        text-align: center;
        background-image: url(img/title-bg.png);
        background-position: center;
        background-repeat: no-repeat;
    }
    .title .text h6{
        line-height: 30px;
        font-size: 18px;
        color: #1AEEBE;
    }
    .title .text p{
        line-height: 25px;
        font-size: 16px;
        color: #FFFFFF;
    }
    .title .line{
        width: 1px;
        height: 120px;
        background-color: #50e3c2;
        position: relative;
        margin: 7px auto 0;
    }
    .title .line:before{
        content: '';
        position: absolute;
        left: -5px;
        top: -5px;
        width: 11px;
        height: 11px;
        background-color: #50e3c2;
        border-radius: 50%;
    }
    .title .line:after{
        content: '';
        position: absolute;
        bottom: -17px;
        left: -19px;
        width: 38px;
        height: 26px;
        background-image: url(img/round.png);
        background-position: center;
        background-repeat: no-repeat;
    }
    .title2{
        left: 297px;
        bottom: 184px;
    }
    .title3{
        left: 547px;
        bottom: 40px;
    }
    .title4{
        left: 660px;
        bottom: 405px;
    }
    .title5{
        left: 880px;
        bottom: 290px;
    }
    .title1 .line{
        -webkit-animation: move1 9s infinite;
        -o-animation: move1 9s infinite;
        animation: move1 9s infinite;
    }
    @keyframes move1 {
        12%,18%{
            height: 151px;
        }
        0%,30%,100%{
            height: 120px;
        }
    }
    .title1 .line:after{
        -webkit-animation: move01 9s infinite;
        -o-animation: move01 9s infinite;
        animation: move01 9s infinite;
    }
    @keyframes move01 {
        14%,18%{
            opacity: .1;
        }
        0%,12%,16%,20%,100%{
            opacity: 1;
        }
    }
    .title2 .line{
        -webkit-animation: move2 9s infinite;
        -o-animation: move2 9s infinite;
        animation: move2 9s infinite;
    }
    @keyframes move2 {
        30%,36%{
            height: 151px;
        }
        18%,48%,100%{
            height: 120px;
        }
    }
    .title2 .line:after{
        -webkit-animation: move02 9s infinite;
        -o-animation: move02 9s infinite;
        animation: move02 9s infinite;
    }
    @keyframes move02 {
        32%,36%{
            opacity: .1;
        }
        0%,30%,34%,38%,100%{
            opacity: 1;
        }
    }
    .title3 .line{
        -webkit-animation: move3 9s infinite;
        -o-animation: move3 9s infinite;
        animation: move3 9s infinite;
    }
    @keyframes move3 {
        48%,54%{
            height: 151px;
        }
        36%,66%,100%{
            height: 120px;
        }
    }
    .title3 .line:after{
        -webkit-animation: move03 9s infinite;
        -o-animation: move03 9s infinite;
        animation: move03 9s infinite;
    }
    @keyframes move03 {
        50%,54%{
            opacity: .1;
        }
        0%,48%,52%,56%,100%{
            opacity: 1;
        }
    }
    .title5 .line{
        -webkit-animation: move5 9s infinite;
        -o-animation: move5 9s infinite;
        animation: move5 9s infinite;
    }
    @keyframes move5 {
        66%,72%{
            height: 151px;
        }
        54%,84%,100%{
            height: 120px;
        }
    }
    .title5 .line:after{
        -webkit-animation: move05 9s infinite;
        -o-animation: move05 9s infinite;
        animation: move05 9s infinite;
    }
    @keyframes move05 {
        68%,72%{
            opacity: .1;
        }
        0%,66%,70%,74%,100%{
            opacity: 1;
        }
    }
    .title4 .line{
        -webkit-animation: move4 9s infinite;
        -o-animation: move4 9s infinite;
        animation: move4 9s infinite;
    }
    @keyframes move4 {
        84%,90%{
            height: 151px;
        }
        72%,100%{
            height: 120px;
        }
    }
    .title4 .line:after{
        -webkit-animation: move04 9s infinite;
        -o-animation: move04 9s infinite;
        animation: move04 9s infinite;
    }
    @keyframes move04 {
        86%,90%{
            opacity: .1;
        }
        0%,84%,88%,92%,100%{
            opacity: 1;
        }
    }
</style>


最近看过此主题的会员

一一

esen_4TUELCHD9M

keer_

0个回答

只看楼主

登录后可回答问题,请登录注册

快速回复 返回顶部 返回列表

小时

全天响应

分钟

快速处理问题

工程师强势助力

明星产品
解决方案
联系合作

400咨询:400-0011-866

技术支持QQ:400-0011-866(工作日9:00-18:00)

产品建议邮箱yixin@esensoft.com

关注我们

扫TA学习更多干货

一对一专家交流

版权所有© 2006-2024 北京亿信华辰软件有限责任公司 京ICP备07017321号 京公网安备11010802016281号