I'm tring to do that with CSS but it isn't working. I've tried using:
.swiper-button-prev {
display: none;
}
.swiper-button-prev:hover {
display: block;
}
but it doesn't effect at all. if I do add some rule like background-color: yellow it does affect the element so the CSS is applied. What am I missing? here's the full thing
This element seems to have a
display: flexwith a higher specificity, which will override thedisplay: nonein posted example. Also:hoverwill not work if display is turned off for the element.Try use
opacityto hide the element, perhaps also consider give it a lower opacity such asopacity: 0.2when not hovered, so that the user can still know that the button exists.Forked project: codesandbox
Example: