@media (pointer: fine) { /* using a mouse or stylus */ } @media (pointer: coarse) { /* using touch */ } @media (hover: hover) { /* can be hovered */ } @media (hover: none) { /* can't be hovered */ }
Copy, paste, learn.