《前端》css实现闪现高亮-2021年1月21日

这篇博客展示了如何使用HTML和CSS创建带有动画效果的圆形按钮。内容包括了圆角按钮的样式定义,以及利用动画实现按钮下方的渐变背景动态效果。通过实例代码,读者可以了解到如何将动画应用到网页元素上,增强用户交互体验。

 

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="mystyle.css">
<style>
  
</style>

<body>
    <div>
        <div class="circle_box">
            <div class="round">
                <div class="circle btn"><a>历史</a></div>
                <div class="circle_bottom animation "></div>
                <div class="circle_bottom2 animation2 "></div>
            </div>
            <div class="round">
                <div class="circle btn"><a>待办</a></div>
                <div class="circle_bottom animation "></div>
                <div class="circle_bottom2 animation2 "></div>
            </div>
         
        </div>
    </div>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>

</body>

</html>

css:

  /* * {
        margin: 0;
        padding: 0;
    } */
/* 
    body {
        background: #000735;
        font-family: "微软雅黑", Arial;
        font-size: 16px;
        color: #fff;
        overflow: -Scroll;
        overflow-x: hidden;
    }

    .Theme {
        width: 1000px;
        margin: 0px auto;
    } */

    /*首页动画*/
    .circle_box {
        width: 978px;
        margin: 50px auto;
        height: 317px;
        position: relative;
    }

.round:nth-child(1) { 
    /* 大数据 */
        position: absolute;
        padding: 13px;
        left: 0px;
        top: 79px;
    }
    .round:nth-child(2) {
        position: absolute;
        left: 176px;
        top: 0;
        padding: 13px;
    }

    .round:nth-child(3) {
        position: absolute;
        left: 199px;
        top: 199px;
        padding: 13px;
    }


    .round:nth-child(4) {
        position: absolute;
        left: 348px;
        top: 128px;
        padding: 13px;
    }
/*  */
    


    /* .circle a {
        font-size: 18px;
        line-height: 100px;
        color: #000735;
        font-weight: bold;
    } */

     /*.circle {
        background: #3a96e1;
        border-radius: 100%; 
        width: 100px;
        height: 100px;
        z-index: 999;
        text-align: center;
        top: 18px;
        left: 18px;
        position: absolute;
    }*/

     .circle_bottom {
        background: rgba(7, 54, 92, 0.4);
         width: 100px;
        height: 40px;
        filter: alpha(opacity=40);
        z-index: -100;
        position: absolute;
        top: 18px;
        left: 18px;
    } 

    /* .circle_bottom2 {
        background: rgba(58, 150, 225, 0.2);
         width: 110px;
        height: 110px;
        filter: alpha(opacity=20);
        z-index: -110;
        position: relative;
    } */

    .animation {
         -webkit-animation: twinkling 2.1s infinite ease-in-out;
        animation: twinkling 2.1s infinite ease-in-out;
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
    }

    .animation2 {
         -webkit-animation: twinkling 2.1s infinite ease-in-out;
        animation: twinkling 2.1s infinite ease-in-out;
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
    }

    @-webkit-keyframes twinkling {
        0% {
            opacity: 0.2;
            filter: alpha(opacity=20);
            -webkit-transform: scale(1);
        }

        50% {
            opacity: 0.5;
            filter: alpha(opacity=50);
            -webkit-transform: scale(1.12);
        }

        100% {
            opacity: 0.2;
            filter: alpha(opacity=20);
            -webkit-transform: scale(1);
        }
    }

    @keyframes twinkling {
        0% {
            opacity: 0.2;
            filter: alpha(opacity=20);
            -webkit-transform: scale(1);
        }

        50% {
            opacity: 0.5;
            filter: alpha(opacity=50);
            -webkit-transform: scale(1.12);
        }

        100% {
            opacity: 0.2;
            filter: alpha(opacity=20);
            -webkit-transform: scale(1);
        }
    }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值