Home > Web Front-end > CSS Tutorial > css to achieve div background color flashing effect

css to achieve div background color flashing effect

王林
Release: 2020-10-27 17:27:13
forward
6369 people have browsed it

css to achieve div background color flashing effect

Let’s take a look at the renderings first:

(Recommended video tutorial: css video tutorial)

css to achieve div background color flashing effect

Code implementation:

<!DOCTYPE html>
<html>
<head>
<style>
@keyframes fade {
    from {
        opacity: 1.0;
    }
    50% {
        opacity: 0.0;
    }
    to {
        opacity: 1.0;
    }
}

.headerBox {
width:100px;
    background: #ff0;
    padding: 10px;
    font-size: 15px;
    height: 100px;
    animation: fade 600ms infinite;
}
</style>
</head>
<body>
<div> </div>
</body>
</html>
Copy after login

Recommended tutorial: CSS tutorial

The above is the detailed content of css to achieve div background color flashing effect. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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