I set pointer events to none on an html element in CSS class and later on I set it to all when the element is hovered but it's not working.
Here are the codes
<nav class="myNav">
<div class="dropdown">
<div>
<h4 class="logo">CARRENTAL</h4>
</div>
<div class="account-sec">
<button class="user_id">CURRENT USER</button>
<ul>
<li><a href="https://www.some_location">MY SITE</a></li>
<li><a href="https://www.some_location">THEMATICS</a></li>
</ul>
</div>
<div class="users-sec">
<button>USERS</button>
<ul>
<li><a href="https://www.all_users">ALL</a></li>
<li><a href="#">CUSTOMERS</a></li>
<li><a href="#">NON CUSTOMERS</a></li>
</ul>
</div>
<div class="cars-sec">
<button>CARS</button>
<ul>
<li><a href="https://www.cars">CARS LIS</a></li>
<li><a href="#">ADD CAR</a></li>
</ul>
</div>
<button><a href="https://www.home" class="home">HOME</a></button>
</div>
Here is my css codes
.account-sec ul,
.users-sec ul,
.cars-sec ul {
position: absolute;
background: #885E5E;
margin-top: 40px;
width: 200px;
height: 150px;
display: flex;
justify-content: space-around;
align-items: center;
flex-direction: column;
border-radius: 6px;
opacity: 0;
pointer-events: none;
transform: translateY(-10px);
transition: all 0.6s ease;
}
.account-sec a,
.cars-sec a,
.users-sec a {
color: white;
text-decoration: none;
}
.dropdown button,
.home {
background: none;
border: none;
color: white;
text-decoration: none;
font-size: 18px;
cursor: pointer;
}
.account-sec button:focus + ul,
.users-sec button:focus + ul ,
.cars-sec button:focus + ul {
opacity: 1;
pointer-events: all;
transform: translateY(0px);
}
So in the code I first set the pointer avents to none and after I set it to all which is not working. Is there any other alternatives to the pointer-events property ? I'd be glad to use it instead. Thanks for helping