css各种练习

2017年10月22日

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	 <style>
	 	.masked h4{
		  display: block;
		  600px;
		  height:200px;
		  background-image: -webkit-linear-gradient(left, #3498db, #f47920 10%, #d71345 20%, #f7acbc 30%, #ffd400 40%, #3498db 50%, #f47920 60%, #d71345 70%, #f7acbc 80%, #ffd400 90%, #3498db);
		  color: transparent;
		  -webkit-text-fill-color:transparent;
		  -webkit-background-clip:text;
		  background-size:200% 100%;
		  -webkit-background-size:200% 100%;
		  -webkit-animation:masked-animation 4s infinite linear;
		}
		@-webkit-keyframes masked-animation{
		    0%{
		      background-position: 0 0;   
		    }
		    100%{
		      background-position: -100% 0;  
		    }
		  }

		 
	 </style>
</head>
<body>
	<div class="masked">
	    <h4>这是一段可选文字这是一段可选文字这是一段可选文字这是一段可选文字</h4>
	</div>
</body>
</html>

  

原文地址:https://www.cnblogs.com/coding4/p/7710473.html