纯CSS3流光边框特效
以下是一个使用纯CSS3实现的流光边框特效的示例代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS3 Glowing Border Effect</title>
<style>
.glowing-border {
width: 200px;
height: 200px;
position: relative;
background-color: #fff;
margin: 50px;
border: 2px solid #5279D8;
border-radius: 50%;
box-shadow: 0 0 0 0 rgba(82, 121, 216, 1);
animation: glowing-border 2s ease-in-out infinite alternate;
}
@keyframes glowing-border {
from {
box-shadow: 0 0 10px 0 rgba(82, 121, 216, 0.5);
}
to {
box-shadow: 0 0 20px 0 rgba(82, 121, 216, 0);
}
}
</style>
</head>
<body>
<div class="glowing-border"></div>
</body>
</html>
这段代码创建了一个带有流光边框特效的圆形元素。.glowing-border
类定义了元素的基本样式,并通过animation
属性应用了名为glowing-border
的关键帧动画,该动画使边框呈现出闪烁的流光效果。
评论已关闭