首页 > 其他分享 >css实现关闭按钮X

css实现关闭按钮X

时间:2022-10-11 15:12:01浏览次数:42  
标签:44 height 关闭 按钮 close 20px my css

html

<div style="height: 100px; width: 100px; border: 1px solid black; position: relative;">
<span class="my_close"></span>
</div>

 

css

.my_close {
background: rgb(44, 44, 44);
color: rgb(204, 232, 255);
border-radius: 12px;
line-height: 20px;
text-align: center;
height: 20px;
width: 20px;
font-size: 18px;
padding: 1px;
top: -10px;
right: -10px;
position: absolute;
}
.my_close::before {
content: "\2716";
}

 

js

jQuery( document ).on("click", ".my_close", function(e){
$(this).parent().css('display', 'none');
});

 

标签:44,height,关闭,按钮,close,20px,my,css
From: https://www.cnblogs.com/syutfu/p/16779254.html

相关文章