鼠标进入缩放
根据transform: scale(1.4);属性进行样式控制,从而实现进行缩放功能,
<style>
.box {
width: 200px;
height: 200px;
border: 1px solid pink;
display: flex;
justify-content: center;
align-items: center;
}
.box .children {
width: 100px;
height: 100px;
background: skyblue;
line-height: 100px;
text-align: center;
}
.box .children:hover {
transform: scale(1.4);
}
</style>
<body>
<div class="box">
<div class="children">
<span>缩放</span>
</div>
</div>
</body>
效果图如下:
1.鼠标未进入效果图
2.鼠标进入效果图