css 屏幕四周报警提示

屏幕四周出现律动的红色边框,产生报警提示的效果。

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Screen Edge Warning</title>
  <style>
    body, html {
      margin: 0;
      padding: 0;
      height: 100%;
    }

    @keyframes colorChange {
      from {
        box-shadow: inset 0 0 0 10px red; /* 红色轮廓 */
      }
      to {
        box-shadow: inset 0 0 0 5px darkred; /* 红色轮廓 */
      }
    }
    .container div{
      position: relative;
      border-radius: 10px;

      float: left;
      margin: 20px;
      padding: 10px;
      height: 100px;
      width: 100px;

    }
    /* 应用动画到元素 */
    .animated-box {
      animation: colorChange 1s infinite alternate; /* 应用动画 */
    }

    @keyframes colorChange2 {
      from {
       outline: 10px red solid;
      }
      to {
        outline: 5px darkred solid;
      }
    }

    .animated-box2 {
      animation: colorChange2 1s infinite alternate; /* 应用动画 */
    }
    @keyframes colorChange3 {
      from {
        box-shadow: inset 0 0 20px 15px red;
      }
      to {
        box-shadow: inset 0 0 10px 7px red;
      }
    }

    .animated-box3 {
      animation: colorChange3 1s infinite alternate; /* 应用动画 */

    }
    body{
      animation: colorChange3 1s infinite alternate; /* 应用动画 */

    }



    .animated-box4::before {
      content: '';
      position: absolute;
      top: -10px;
      right: -10px;
      bottom: -10px;
      left: -10px;
      z-index: -1;
      background: radial-gradient(circle, red, #ffa73b);
      border-radius: inherit;
      box-shadow: 0 0 20px 15px rgba(0, 0, 0, 0.5);
    }
  </style>
</head>
<body >
<div class="container">
  <div class="animated-box">box-shadow</div>
  <div class="animated-box2">outline</div>
  <div class="animated-box3">渐变</div>
</div>


<script>
</script>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值