after pseudo element is not appearing

<div class="parent">
<img src='https://unsplash.it/500/500' class="logo" />
<div>
<h4 class="title">Paolo Cannone</h4>
<span>24k listeners </span>
</div>
</div>
<div class="parent">
<img src='https://unsplash.it/500/500' class="logo" />
<div>
<h4 class="title">Paolo Cannone</h4>
<span>24k listeners </span>
</div>
</div>
.parent {
display: flex;
position: relative;
flex-direction: row;
align-items: center;
gap: 1rem;
}
.logo {
height: 3rem;
width: 3rem;
object-fit: cover;
border-radius: 50%;
position: relative;
}
.logo::after {
content: '';
width: 10px;
height: 10px;
border-radius: 50px;
background: red;
outline: 2px solid red;
position: absolute;
top: 0;
z-index: 100000;
}

.title {
font-weight: 900;
margin-bottom: -0.3rem;
}
.parent {
display: flex;
position: relative;
flex-direction: row;
align-items: center;
gap: 1rem;
}
.logo {
height: 3rem;
width: 3rem;
object-fit: cover;
border-radius: 50%;
position: relative;
}
.logo::after {
content: '';
width: 10px;
height: 10px;
border-radius: 50px;
background: red;
outline: 2px solid red;
position: absolute;
top: 0;
z-index: 100000;
}

.title {
font-weight: 900;
margin-bottom: -0.3rem;
}
Why ::after is not appearing? I even tried setting the content but it still does not work, if I try to look for it in the dev tools, I can find it, but when I click on it to see its position, there's no arrow pointing to it
5 Replies
Mannix
Mannix2y ago
img can't have pseudo elements wrap the img in a div and put your logo class on it
lko
lko2y ago
Thanks But is there a reason why?
Mannix
Mannix2y ago
most self closing tags can't have pseudo elements
lko
lko2y ago
Thanks
CodeNascher
CodeNascher2y ago