Home > Article > Web Front-end > How to achieve the looming effect when the mouse slides over in css3
In CSS3, you can use the ":hover" selector and display attribute to achieve the looming effect when the mouse slides over it. You only need to add the "element:hover{display:none;}" style to the element.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
css3 realizes the looming effect of mouse sliding over
In css3, you can use the ":hover" selector and display attribute to realize the mouse sliding effect. Excessive looming effect.
Just use the ":hover" selector to select the state of the element when the mouse is over it, and add the "display:none;" style to hide the element.
In this way, when the mouse slides over the element, the element is hidden; when the mouse slides out of the element, the element is displayed.
<!DOCTYPE html> <html> <head> <style> div { width: 520px; height: 50px; background-color: #008000; /* display: block; */ } div:hover{ display:none; } </style> </head> <body> <div> </div> </body> </html>
(Learning video sharing: css video tutorial)
The above is the detailed content of How to achieve the looming effect when the mouse slides over in css3. For more information, please follow other related articles on the PHP Chinese website!