【发布时间】:2018-07-04 13:08:39
【问题描述】:
我已经为 3 种类型的设备设置了访问者门户:移动设备(宽度小于 800 像素)、低分辨率桌面和高分辨率桌面,如下所示:
<link media="only screen and (min-width: 801px) and (max-height: 899px)" href="..." rel="stylesheet" type="text/css">
<link media="only screen and (min-width: 801px) and (min-height: 900px)" href="..." type="text/css">
<link media="only screen and (max-width: 800px)" href="..." rel="stylesheet" type="text/css">
这一切都很好,但对于 iPad Pro 纵向,屏幕宽度小于 800 像素,但选择的样式表是低分辨率桌面。我需要进行哪些更改才能使其正常工作?
编辑(澄清问题)
当我做这样的事情时
<link media="only screen and (min-width: 801px) and (max-height: 899px)" href="..." rel="stylesheet" type="text/css">
<link media="only screen and (min-width: 801px) and (min-height: 900px)" href="..." rel="stylesheet" type="text/css">
<link media ="only screen and (max-width: 800px),
only screen and (max-device-width:1024px) and (-webkit-min-device-pixel-ratio:1.1) and (orientation:portrait),
only screen and (max-device-height:1366px) and (-webkit-min-device-pixel-ratio:1.1) and (orientation:landscape)"
href="..." rel ="stylesheet" type="text/css">
问题在于样式在不同的分辨率下会混淆。我希望让它工作,以便在任何时候只有一个样式表处于活动状态。
【问题讨论】:
-
你指定视口大小了吗?
-
@MunimMunna:
-
你可以使用https://mydevice.io/查看ipad显示的宽度。
-
您正在使用视口
meta标签。澄清一下,physical size与CSS size不同。 Apple iPad Pro 9.7 CSS size is : 768 - 1024px Apple iPad Pro: 1024 - 1366px 来源:mydevice.io/devices 你能创建一个实例或提供地址吗?哪个 CSS 文件应该在 Ipad Pro 上处于活动状态,第二个(低分辨率桌面)?
标签: css ipad media-queries