Steps to implement animated drop-down menu effect using css3

php中世界最好的语言
Release: 2017-11-30 10:10:53
Original
2579 people have browsed it

We know that drop-down menus made using CSS3 are not compatible with IE6, and IE8 and below do not support some CSS3 properties, such as opacity, transition, etc. This time I will tell you about the steps to implement the animated drop-down menu effect using CSS3.


site-navigation ul ul{min-width: 100px; position: absolute; left:0; top:100%; visibility: hidden; opacity: 0; -webkit-transition:all .3s ease-in-out; transition:all .3s ease-in-out; margin-top:20px; background-color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2); background-color: #F0F0F0;}
.site-navigation ul li:hover > ul{visibility: visible; opacity: 1; margin-top:0;}
.site-navigation ul ul ul{ left:100%; top:0; margin-top: 0; margin-left: 20px;}
.site-navigation ul ul li:hover > ul{margin-left:0;}
.nav ul{height:0;overflow:hidden;left:0; top:100%;position:absolute;}
.nav li:hover ul{height:auto;width:180px}
.nav li ul li{opacity:0;-webkit-transition:0.5s;transition:0.5s;width:100%;-webkit-transition-delay:0s;transition-delay:0s}
.nav li:hover ul li{opacity:1;-webkit-transition-delay:0.5s;transition-delay:0.5s}
.nav ul li a{background:#7770B4;border-color:#6E67A6;color:#fff;line-height:1px;-webkit-transition:1.5s;transition:1.5s}
.nav li:hover ul li a{line-height:35px}
.nav ul{left:0; position:absolute;top:100%; min-width: 120px; visibility: hidden; opacity: 0;}
.nav li ul li{opacity:0; -webkit-transition:0.5s;transition:0.5s;width:100%;-webkit-transition-delay:0s;transition-delay:0s}
.nav li:hover > ul{opacity: 1; visibility: visible;}
.nav li:hover > ul > li{opacity:1;-webkit-transition-delay:0.5s;transition-delay:0.5s}
.nav ul li a{background:#7770B4;border-color:#6E67A6;color:#fff;line-height:1px;-webkit-transition:1.5s;transition:1.5s; white-space: nowrap;}
.nav li:hover > ul > li a{line-height:35px}
.nav ul ul{left:100%; top:0;}
Copy after login


I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

What browsers require compatibility verification in HTML

html implementation of 3d suspension effect Steps

Make div width adaptive teaching

The above is the detailed content of Steps to implement animated drop-down menu effect using css3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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