JSFiddle - React, Tailwind, and code Playground
by cfddream
HTML
<div class="avatar">
<img src="https://secure.gravatar.com/avatar/c062c91b987ba164275c0d973b475f3d?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" height="50" width="50" />
<i class="icon"></i>
</div>
CSS
.avatar {
position: relative;
width: 50px;
height: 50px;
border: 4px solid #1175A5;
opacity: 0.5;
border-radius: 7px;
}
.avatar:before {
content: '';
position: absolute;
left: -2px;
top: -2px;
width: 50px;
height: 50px;
border: 2px solid #1175A5;
border-radius: 7px;
}
img {
border-radius: 4px;
}
.icon {
position: absolute;
right: 0;
bottom: 0;
width: 14px;
height: 14px;
background: red;
border-radius: 4px 0 4px 0;
}
JavaScript
$('.icon').click(function (e) {
alert('这蛋必需割!');
});