//method 1(id选择器)
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
<style type="text/css">
#extend:HOVER {
cursor: pointer;
transition: all 0.6s;
transform: scale(1.5);
}
</style>
</head>
<body>
<div id="extend" style="background-color:#09FFCB; height:100px; width:100px;float:left;">test1</div>
<div id="extend" style="background-color:#ABFE05; height:100px; width:100px;float:left;margin-left:50px;">test2</div>
</body>
</html>
//method 2(元素选择器)
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
<style type="text/css">
div:HOVER {
cursor: pointer;
transition: all 0.6s;
transform: scale(1.5);
}
</style>
</head>
<body>
<div style="background-color:#09FFCB; height:100px; width:100px;float:left;">test1</div>
<div style="background-color:#ABFE05; height:100px; width:100px;float:left;margin-left:50px;">test2</div>
</body>
</html>
Div获得鼠标焦点时自动放大
最新推荐文章于 2023-06-15 14:45:01 发布