您的位置:首页 > Web前端 > CSS

html,css实现呼吸灯效果

2019-06-28 15:20 225 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/rolinabc/article/details/94006460

1、html+css实现呼吸灯效果,如下图:

代码如下:

[code]<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
body{
width: 100%;
height: 100%;
background-color: black;
}
.outer{
width: 150px;
height: 150px;
margin: 0 auto;
margin-top: 300px;
border-radius: 50%;
background-color: yellow;
box-shadow: yellow 0px 0px 80px ;
}
.inner{
float: left;
margin-left: -60px;
margin-top: -60px;
width: 500px;
height: 500px;
background-color: black;
opacity: 0.7;
animation-name: move;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes move{
from{
opacity: 0;
}
to{
opacity: 0.7
}
}
</style>
</head>
<body>
<div class="outer">
<div class="inner"></div>
</div>
</body>
</html>

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: