jquery - CSS 不会在 iPhone 刷新时加载

标签 jquery html css

<link rel="stylesheet" media="screen and (min-width: 20px) and (max-width: 375px) and (orientation:portrait)" href="css/detailsLayout280.css" />
<link rel="stylesheet" media="screen and (min-width: 20px) and (max-width: 375px) and (orientation:portrait)" href="css/copy280.css" />
<link rel="stylesheet" media="screen and (min-width: 376px) and (max-width: 700px) and (orientation:landscape)" href="css/detailsLayout320.css" />
<link rel="stylesheet" media="screen and (min-width: 376px) and (max-width: 700px) and (orientation:landscape)" href="css/copy320.css" />

我有一个页面,其中 CSS 最初不会在 iPhone 上加载,但如果我来回切换方向,它会加载。

然后通过单击刷新,CSS 不会再次加载,直到我再次更改方向。

这只发生在二级页面上。主页的设置方式大致相同,而且运行良好。

我也有这个:

<meta name="viewport" content="width=device-width, initial-scale=1">

我需要 iPad CSS。如果我解决了这个问题,手机的问题就消失了(虽然缩小了),但我需要它用于 iPad。

为什么 CSS 不加载除非我改变方向?

谢谢。

最佳答案

您可能需要指定像素密度,因为智能手机现在的宽度超过 700 像素。

特定于浏览器

(-moz-min-device-pixel-ratio: 2)
(-o-min-device-pixel-ratio: 2/1)
(-webkit-min-device-pixel-ratio: 2)
(min-device-pixel-ratio: 2)

关于如何应用它的快速示例

<link rel="stylesheet" media="screen and (min-width: 20px) and (max-width: 375px) and (orientation:portrait) and (-webkit-min-device-pixel-ratio: 2)" href="css/detailsLayout280.css" />

关于jquery - CSS 不会在 iPhone 刷新时加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23093972/

相关文章:

jquery mobile自定义图标,图标根本不渲染

html - 我可以将 CSS3 与 XHTML 1.0 一起使用吗?

html - iOS Safari 缩小跨度中的文本以悬挂缩进段落

css - 字体粗细 :700 or font-weight:bold which one we should follow in CSS?

css - 顺时针旋转 180 度再旋转 360 度

javascript - 如何在javascript中更改用户输入和计算输出之间的背景颜色

javascript - 自动重新加载 Div

javascript - Jquery Autocomplete - 组合数据源 - 主要和后备

javascript - 是否可以在输入类型编号中禁用 'step'

html - 添加按钮会增加宽度