I am currently working on a CSS Media Query to target different styles for mobile devices, desktops with low resolution screens, and desktops with high resolution screens. I initially attempted using the hover query to distinguish between mobile and desktop devices based on screen height.
While this method was successful in selecting desktop styles, I encountered an issue where my Samsung cellphone displayed the div background as green instead of the intended blue.
How can I adjust my code to achieve the desired outcome?
@media (hover: hover) and (max-height: 999px) {
div {background:green;}
}
@media (hover: hover) and (min-height: 1000px) {
div {background:red;}
}
@media (hover: none) {
div {background:blue;}
}
<div style="width:200px;height:200px;"></div>