
本文主要介绍通过css3和不透明性实现呼吸光效果. 本文将详细介绍示例代码. 它对每个人的学习或工作都有一定的参考价值. 让我们一起学习吧

本文介绍了通过css3和不透明性实现呼吸光效果的方法,我将与您分享如下:

<!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>

以上是本文的全部内容. 希望对大家的学习有所帮助. 我也希望每个人都支持该脚本主页.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/shouji/article-158579-1.html
唱的太好了
反正不合格的均非正品