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. CSS根据屏幕分辨率自动调整样式

    2024-07-18 02:56:03       31 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-18 02:56:03       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-18 02:56:03       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-18 02:56:03       57 阅读
  4. Python语言-面向对象

    2024-07-18 02:56:03       68 阅读

热门阅读

  1. Chapter 2: An Introduction to ASP.NET Core in Layman‘s Terms

    2024-07-18 02:56:03       18 阅读
  2. function calling实现调用理杏仁api获取数据

    2024-07-18 02:56:03       23 阅读
  3. 算法热门工程师面试题(一)

    2024-07-18 02:56:03       24 阅读
  4. RocketMQ集群中的broker挂了会怎样?

    2024-07-18 02:56:03       17 阅读
  5. Web前端三剑客入门学习网站推荐与编译软件

    2024-07-18 02:56:03       23 阅读
  6. Eureka介绍与使用

    2024-07-18 02:56:03       23 阅读
  7. 科研绘图系列:R语言雷达图(radar plot)

    2024-07-18 02:56:03       20 阅读
  8. 面试中如果被问到项目遇到的难题如何解决

    2024-07-18 02:56:03       20 阅读