0
我想在设备是平板电脑(包括Apple iPad Pro(1366像素宽)和Microsoft Surface Pro 3(1440像素宽))时应用某些CSS样式,但而不是当设备是笔记本电脑时(1024px减去滚动条或更大)。当我使用此代码时:对于所有平板电脑(包括“Pro”版本)的媒体查询,没有笔记本电脑
@media (min-width: 768px) and (max-width: 991px) and (max-width: 1440px) {
/*
non-smartphone touchscreen optimized styles here
large buttons, menus with everything visible without :hover etc.
*/
}
大平板电脑上的所有样式(992px-1440px)都不正确。我在媒体查询中尝试了许多不同的和/或最小值/最大值的组合,至少在一台设备上渲染总是错误的。我怎么解决这个问题?
https://css-tricks.com/snippets/css/media-queries-for-standard-devices/ – timothyclifford
我最好的提示是_stop device detection_并使用视口宽度。此外,您可以检测到设备是否触摸。 – LGSon