.box{
position: relative;
width: 400px;
height: 250px;
background: linear-gradient(to top,#000,#262626);
margin: 200px auto;
}
.box::before, .box::after{
content: '';
position: absolute;
width: 404px;
height: 254px;/* 宽和高要比div大出4px这样上下左右才能看见残影 */
background: linear-gradient(45deg,#fb0094,#0000ff,#00ff00,#ffff00,#ff0000,#fb0094,#0000ff,#00ff00,#ffff00,#ff0000);
background-size: 400%;
z-index: -1;
animation: bj 20s linear infinite;
top: -2px;
left: -2px;
}
.box::after{
filter: blur(20px);
}
@keyframes bj {
0%{
background-position: 0 0;
}
50%{
background-position: 300% 0;
}
100%{
background-position: 0 0;
}
}
</style>
</head>
<body>
<div class="box"></div>
</body>