JSFiddle - React, Tailwind, and code Playground
by Kirubel Girma
HTML
<a href="#" class="mlink">
<img src="https://i.pravatar.cc/48?img=10" alt="user name" title="user name" width="48" height="48" class="mimg" />
<span class="mnotify">
7
<span class="mdisc"> new emails </span>
</span>
</a>
CSS
.mlink {
display: inline-flex;
position: relative;
justify-content: center;
align-items: center;
border-radius: 9999px;
width: 3rem;
height: 3rem;
color: #ffffff;
}
.mimg:hover {
scale: 1.2;
transition: scale .145s ease-out;
}
.mimg {
border-radius: 9999px;
max-width: 100%;
}
.mnotify {
display: inline-flex;
position: absolute;
top: -0.375rem;
right: -0.375rem;
padding-left: 0.375rem;
padding-right: 0.375rem;
gap: 0.25rem;
justify-content: center;
align-items: center;
border-radius: 9999px;
border-width: 2px;
border-color: #ffffff;
font-size: 0.875rem;
line-height: 1.25rem;
color: #ffffff;
background-color: #EC4899;
}
.mdisc {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}