zoukankan      html  css  js  c++  java
  • CSS实现漂亮的小水球效果

    先看效果图:
    在这里插入图片描述
    代码:

    <!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{
    				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: "";
    				 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

  • 相关阅读:
    从小到大全排列
    众数-摩尔投票法
    链表复制
    2019.8.29刷题统计
    2019.8.28刷题统计
    2019.8.27刷题统计
    2019.8.26
    2019.8.25刷题统计
    2019.8.24
    2019.8.23刷题统计
  • 原文地址:https://www.cnblogs.com/AlexanderZhao/p/12945716.html
Copyright © 2011-2022 走看看