The content of this article is about the code example of CSS to implement menu button animation. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
To write a drop-down menu, click the button. The menu entrance is to click an icon button. Before, I used a picture instead. Today, I suddenly want to use CSS to write an effect. The main reference is the button in the upper right corner of The Paper mobile terminal
Effect:
##HTML
//vue 中通过点击事件改变class <div> <div></div> <div></div> <div></div> </div>CSS
<!--按钮容器 START--> .burger { cursor: pointer; display: inline-block; margin: 7px 6px 0 0; outline: none; } <!--按钮容器 END--> <!--三条横线 通过rotate3d实现旋转 START--> .burger p { width: 30px; height: 4px; margin-bottom: 6px; background-color: rgb(51, 51, 51); transform: rotate3d(0, 0, 0, 0); } <!--三条横线 END--> .burger.transform p { background-color: transparent; } .burger.transform p:first-of-type { top: 10px; transform: rotate3d(0, 0, 1, 45deg) } .burger.transform p:last-of-type { bottom: 10px; transform: rotate3d(0, 0, 1, -45deg) } <!--点击后第一个和第三个横线的效果 START--> .burger.transform p:first-of-type, .burger.transform p:last-of-type { transition: transform .4s .3s ease, background-color 250ms ease-in; background: #00c1de; } <!--点击后第一个和第三个横线的效果 END--> <!--取消点击后恢复动画 START--> .burger p:first-of-type, .burger p:last-of-type { transition: transform .3s ease .0s, background-color 0ms ease-out; position: relative; } <!--取消点击后恢复动画 END-->The animation effect can also be achieved by using transition only. For changes in different attributes, mastering the change time and delay time can make the animation sequence
The above is the detailed content of CSS code example for menu button animation. For more information, please follow other related articles on the PHP Chinese website!

Here's a container with some child elements:

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.