效果图
CSS 代码:
*{ margin: 0; padding: 0; } body{ height: 100vh; width: 100%; overflow: hidden; background-image: linear-gradient(125deg,#F44336,#E91E63,#9C27B0,#3F51B5,#2196F3); background-size: 400%; font-family: "montserrat"; animation: bganimation 15s infinite; } .text{ color: #fff; font-size: 22px; text-align: center; margin: 350px 0; /* text-transform: uppercase; */ } @keyframes bganimation{ 0%{ background-position: 0% 50%; } 50%{ background-position: 100% 50%; } 100%{ background-position: 0% 50%; } }
推荐教程:《CSS教程》
立即学习“前端免费学习笔记(深入)”;
以上就是CSS 实现背景动态渐变效果的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号