CSS实现漂亮的小水球效果

原文:CSS实现漂亮的小水球效果

先看效果图:
CSS实现漂亮的小水球效果
代码:

Copy
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>小水球</title> <style> *{ margin:0; padding: 0; } body{ height: 100vh; background: linear-gradient(rgb(95,95,250) 10%,rgb(3,3,110)); } .main,.wave{ width:200px; height:200px; border-radius: 50%; position: absolute; left: 50%; top:50%; transform: translate(-50%,-50%); } .main{ border:3px solid darkturquoise; padding: 10px; } .wave{ background: darkturquoise; overflow: hidden; } .wave::before{ content: "水球"; position: absolute; left: 50%; top: 0px; color: darkturquoise; z-index: 99; transform: translate(-50%,30px); text-transform: uppercase; } .wave::after{ content: ""; width: 300px; height: 300px; background: rgba(255,255,255,0.8); position: absolute; left: 50%; top: 0; transform: translate(-50%,-60%); border-radius: 40%; animation: wave 5s linear infinite; } @keyframes wave{ 100%{ transform: translate(-50%,-60%) rotate(360deg); } } </style> </head> <body> <div class="main"> <div class="wave"></div> </div> </body> </html>

参考视频:https://www.bilibili.com/video/BV1nV411d7Q2

CSS实现漂亮的小水球效果

上一篇:php的三种CLI常量:STDIN,STDOUT,STDERR


下一篇:【转】可能会导致.NET内存泄露的8种行为