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

How to make css disappear gradually

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-15 14:07:396297browse

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;
      }
    }

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!

Statement:
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