Home  >  Article  >  Web Front-end  >  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

青灯夜游
青灯夜游Original
2022-03-07 16:23:281832browse

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>

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!

Statement:
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