CSS realizes background dynamic gradient effect

Guanhui
Release: 2020-06-04 13:14:34
forward
2576 people have browsed it

CSS realizes background dynamic gradient effect

Rendering

CSS realizes background dynamic gradient effect

CSS code:

*{
    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%;
    }
}
Copy after login

Recommended tutorial: "CSS Tutorial

The above is the detailed content of CSS realizes background dynamic gradient effect. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:zhihu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template