I have tag with class="dropdown-button" and want to style its ::after on first LI element hover.
I am trying this:
<ul class="dropdown-button">
<li> home </li>
<li> about us </li>
</ul>
style {
.dropdown-button {
margin-top:10px;
border:1px solid #ccc;
}
.dropdown-button::after {
border-bottom: 6px solid #FFFFFF;
border-left: 6px solid rgba(0, 0, 0, 0);
border-right: 6px solid rgba(0, 0, 0, 0);
content: "";
display: inline-block;
left: 7px;
position: absolute;
top: -6px;
}
// To solve problem, I do this :
.dropdown-button li:first-child:hover .dropdown-button::after{
border-bottom: 6px solid #a1a2a3;
content: "";
}
//But this doesn't work.
}
Any suggestions?