I cant seem to properly activate the :hover state for p elements inside a parent div
For all p elements in the parent div there is an :after with 0 width to create an underlining when hovered. I want the width to go from "0" to "2em" when the p is hovered.
I'm not sure how to properly target the p and the :after when hovered.
I though it should look something like below.
HTML
<div class="parent">
<p>Menu Option A</p>
<p>Menu Option B</p>
</div>
CSS
.top_menu_wrapper p:after {
content: "";
display: block;
height: 3px;
width: 0em;
background: white;
margin: auto;
transition: all 0.4s ease;
}
.parent p:hover p:after {
width: 2em;
}