I am beating my head here over why an ::after
element is not rendered at all when being on input element, but on some div it renders just fine.
I am trying to make a performance friendly focus effect on an input element, so when it's in focus, it gets a nice glow from the after element.
Here's what I have
return (
<div className="App">
<input placeholder="Username"></input>
<div className="divider"></div>
</div>
)
and the css
input,
.divider {
width: 300px;
height: 40px;
position: relative;
}
input::after,
.divider::after {
content: "";
position: absolute;
left: 0;
width: 100%;
height: 100%;
box-shadow: 0px 0px 16px 3px #61DAFB;
}
and here's the final product
When inspecting the ::after element for the div, it is right there in the screen, event if I remove its dimensions, but for the input element, it's in the DOM, but when you select it it's nowhere in sight.
Why is that?