Home > Web Front-end > CSS Tutorial > How to make css disappear gradually

How to make css disappear gradually

醉折花枝作酒筹
Release: 2023-01-05 16:08:43
Original
6370 people have browsed it

Css method to gradually disappear: first define the animation using the "@keyframes" rule and animation attributes; then add the "opacity:1;" style to the beginning of the animation to set the normal state; finally add the "opacity:1;" style to the end of the animation "opacity:0;" style sets the fully transparent state and hides the element.

How to make css disappear gradually

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

.hideSlow{
    background: #a40808;
      color: #fff;
      animation: hidetip 5s 1;
      animation-fill-mode: forwards;
      -webkit-animation: showtip 5s 1;
      -webkit-animation-fill-mode: forwards;
}
@keyframes hidetip {
      from {
        opacity: 1;
      }
      to {
        opacity: 0;
      }
    }
    @-webkit-keyframes hidetip {
      from {
        opacity: 1;
      }
      to {
        opacity: 0;
      }
    }
Copy after login

Recommended learning: css video tutorial

The above is the detailed content of How to make css disappear gradually. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
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