0
I need to hide an "X" icon when the device is in a web resolution with the pointer cursor and keep on touch devices (e.g., tablet and mobile).
I don’t know if I need to use the media pointer, to remove the icon in this case.
I tested this CSS, but I couldn’t solve it:
.menu-web__logo-icon-x {
color: white;
cursor: pointer;
min-width: 28px;
min-height: 28px;
margin-left: auto;
margin-right: 16px;
}
}
@media (cursor: pointer) {
.menu-web {
.menu-web__logo-icon-x {
display: none;
}
}
}
How can I create a media query to determine whether the user owns (or not) mouse?
Do you consider the touchpad a mouse? If you have a mouse connected on the touch device, what is the expected behavior?
– Rafael Tavares
I am not considering the fact that the user uses a mouse in touchpad, I did not think about this behavior if use a mouse for example on the tablet.
– Alessandra Marinho
This can help you https://answall.com/questions/351537/qual-a-diff%C3%a7a-entre-o-media-query-Pointer-e-any-Pointer
– hugocsl
I realized that media query
pointer: fine
, does not work in older browsers like IE8. There is some other possibility that works with that browser in particular?– Alessandra Marinho