通过css3动画和opacity透明度实现呼吸灯效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"> <title>呼吸灯</title> /*也可以通过加层罩,通过设置层罩透明度来实现亮度动画*/ <style> body{ background-color: black; } div{ margin: 0 auto; margin-top: 200px; width: 300px; height: 300px; border-radius: 50%; background-color: yellow; box-shadow: 0 0 80px red; animation-name: light; animation-duration: 3s; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: alternate; } @keyframes light{ from{ opacity: 1; } to{ opacity: 0.2; } } </style>
</head>
<body>
<div></div>
</body>
</html>
相关推荐
vavid 2020-04-20
aSuncat 2020-03-01
CaiKanXP 2020-01-12
lanzhusiyu 2020-01-05
我就是停不下来 2014-01-16
sorryericsson 2014-01-16
somboy 2019-11-06
jiedinghui 2019-10-28
lanzhusiyu 2020-06-21
AlisaClass 2020-04-11
云端漂移 2020-03-08
coulder 2020-03-07
dazhifu 2020-03-03
lanzhusiyu 2020-03-01
冰蝶 2020-03-01