【问题标题】:responsive design: weird layout display on small devices and Iphone响应式设计:小型设备和 Iphone 上的奇怪布局显示
【发布时间】:2014-05-21 17:14:30
【问题描述】:

我有一个奇怪的问题,希望有人能帮忙。

我设计了这个响应式site,它工作得很好,但在手机上它做了一件奇怪的事情。在最终站点之前,因为它会在一个小屏幕上看到,它加载了几毫秒,站点全部搞砸了,侧边栏在主要内容上方,但之后它加载了正确的布局。 我对此并不太担心,但后来我意识到在 iphone 上你只能看到混乱的网站,而不是应有的正确布局。

我的媒体查询是这样的:

<link href="css/styles.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" media="only screen and (min-width:50px) and (max-width:479px)"   href="css/screen-layout-small.css">
<link rel="stylesheet" type="text/css" media="only screen and (min-width:480px) and (max-width:767px)"  href="css/screen-layout-medium.css">
<link rel="stylesheet" type="text/css" media="only screen and (min-width:768px) and (max-width:959px)"  href="css/screen-layout-large.css">
<link href='http://fonts.googleapis.com/css?family=Dosis:200,300,400' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=2">

希望有人可以提供帮助,因为我在这里有点发疯了。谢谢!

【问题讨论】:

  • 我想我修好了。我将媒体查询从 html 更改为 css,并专门使用 @media (device-height: 568px) 和 (-webkit-min-device-pixel-ratio: 2) {} 解决了 iphone,它似乎现在可以工作了
  • 我也面临同样的问题..你能告诉我你是怎么解决的吗?

标签: iphone responsive-design


【解决方案1】:

我现在在我的 android 手机上查看了该网站,我注意到这个 div(barritaloca) 在您的媒体查询中的格式不正确。 它浮动到首页,从而导致网站加载异常。 您应该更正该 div 并还原。 同时,在此处发布您的 css 以供审核 谢谢

【讨论】:

  • 你可以在评论中这样说,因为这似乎不是一个答案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-03-26
  • 2019-08-03
  • 2013-04-23
  • 2020-01-08
  • 2013-05-24
  • 1970-01-01
  • 2021-02-20
相关资源
最近更新 更多