Home > Web Front-end > Front-end Q&A > How to achieve the looming effect when the mouse slides over in css3

How to achieve the looming effect when the mouse slides over in css3

青灯夜游
Release: 2022-03-07 16:23:28
Original
1882 people have browsed it

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.

How to achieve the looming effect when the mouse slides over in css3

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>
Copy after login

How to achieve the looming effect when the mouse slides over in css3

(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!

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