As I work on developing a website with responsive design, I am facing the challenge of differentiating the layout between tablets in landscape mode and desktops using media queries. The current media queries I have are:
<link href="base.css" rel="stylesheet"/>
<link href="desktop.css"
media="only screen and (min-width: 801px)" rel="stylesheet"/>
<link href="tablet.css"
media="only screen and (min-width: 629px) and (max-width: 800px) and
(orientation:portrait),
only screen and (min-height: 629px) and (max-height: 800px) and
(orientation:landscape)" rel="stylesheet"/>
The issue I'm encountering is that the desktop.css
stylesheet is being applied to tablets in landscape mode. With iPads in landscape mode having a width of 1024px
, which is common for PCs, how can I differentiate a 1000px
wide desktop from a tablet in landscape mode using media queries?
P.S. It's important for me to use media queries as the website will be cached and CDNed, making server-side detection ineffective.
P.S.2.
<link href="desktop.css"
media="only screen and (min-width: 801px),
not only screen and (min-height: 629px) and (max-height: 800px)
and (orientation:landscape)" rel="stylesheet"/>
Despite attempting the above solution, the issue remains unresolved.