css实现图片关闭按钮
显示效果
代码如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css实现图片关闭按钮</title>
</head>
<style>
.close {
background: #fff;
color: #3c3c3c;
border: 1px solid #3c3c3c;
border-radius: 100%;
text-align: center;
line-height: 20px;
height: 20px;
width: 20px;
font-size: 18px;
padding: 1px;
top: -10px;
right: -10px;
position: absolute;
}
.close::before {
content: "\2716";
}
</style>
<body>
<div style="margin:20px 20px;height: 100px; width: 100px; border: 1px solid black; position: relative;">
<span class="close"></span>
</div>
</body>
</html>