核心思路:利用边框半径实现圆形,鼠标经过事件加上2d缩放
代码实现:
<style>
div {
width: 100px;
margin: 0 auto;
}
a {
display: block;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: transparent;
border: 1px solid #000;
text-decoration: none;
text-align: center;
line-height: 50px;
color: black;
transition: all 0.2s;
}
a:hover {
transform: scale(1.1);
}
</style>
</head>
<body>
<div>
<a href="#">1</a>
</div>
</body>