Home >Web Front-end >HTML Tutorial >Fade out transition effect using CSS3_html/css_WEB-ITnose

Fade out transition effect using CSS3_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:50:55830browse

Summary:

CSS3 has been applied to many websites and is very beneficial for creating dynamic interactive websites. Today I will share a fade-out effect on mouse hover using transition.

Code:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>Document</title>    <style>        div.demo {          float: left;          border:1px solid #ccc;        }        div.demo i {          cursor: pointer;          height: 50px;          transition: opacity 2s;          width: 50px;          background: #000;          float: left;          margin: 5px;          opacity: 0;        }        div.demo i:hover {          opacity: 1;          transition-duration: 0s;        }    </style></head><body>    <div class="demo">        <div>            <i></i>            <i></i>            <i></i>            <i></i>            <i></i>            <i></i>            <i></i>            <i></i>        </div>    </div></body></html>

Effect:

You can see the effect by hovering the mouse over

                                                                                               🎜>

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