


How to achieve the lengthening effect when the mouse moves up in CSS3? (Pictures + Videos)
This article mainly introduces you to the method of using css3 to achieve the variable length effect when the mouse moves in.
In front-end page design, the function of CSS is extremely powerful. As long as you use it well, you can achieve various wonderful dynamic effects on many websites. So in the previous article, I also shared with you some methods of using CSS to achieve animation effects, such as [How to achieve rotation and movement effects in Css3 animation? 】【How to achieve the slow enlargement effect of images when hovering the mouse in css3?】Wait for the introduction of knowledge points, friends in need can choose to refer to it.
Let’s combine it with a simple code example to introduce to you the css3 method to achieve the effect of making the div longer when the mouse moves into the div.
<!DOCTYPE html> <html> <meta charset="utf-8"> <title>Css3实现鼠标移上变长特效</title> <head> <style> .hover{ width: 200px; height: 200px; border-radius: 10px; background: red; margin-top: 100px; margin-left: 100px; transition: width 2s; } .hover:hover{ background: blue; width: 500px; } </style> </head> <body> <div class="hover"> hover </div> </body> </html>
In fact, this effect is very basic and simple. Mainly master the use of :hover selector and transition.
:hover selector is used to select the element on which the mouse pointer is floating.
Transition transition is a composite attribute, including the four sub-properties of transition-property, transition-duration, transition-timing-function, and transition-delay. A complete transition effect is completed through the cooperation of these four sub-properties
The effect achieved by the above code in the foreground is as shown below:
This article This article is an introduction to the css3 method to achieve the variable length effect when the mouse moves in. It is also very simple. I hope it will be helpful to friends in need!
If you want to learn more about front-end related knowledge, you can follow the PHP Chinese website CSS3 Video Tutorial, CSS Video Tutorial, Bootstrap Tutorial, etc. Related tutorials, everyone is welcome to refer to and study!
More cool CSS3, html5, javascript special effects codes, all in: javascript special effects collection
The above is the detailed content of How to achieve the lengthening effect when the mouse moves up in CSS3? (Pictures + Videos). For more information, please follow other related articles on the PHP Chinese website!

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

SublimeText3 Chinese version
Chinese version, very easy to use

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
