2

我正在开发这个响应式 Wordpress 网站:http ://www.allisoncassels.com/Test/并且我的媒体查询有问题。

我为以下断点编写了 CSS:

/* Portrait Tablets */
@media only screen and (min-width: 768px) and (max-width: 959px) 

/*  Portrait Mobiles */
@media only screen and (max-width: 767px) 

/* Landscape Mobiles */
@media only screen and (min-width: 480px) and (max-width: 767px)

在桌面上,一切看起来都很棒。在我的手机和平板电脑上,有些东西是移动的,有些东西仍然像桌面一样显示(我有显示的东西:没有显示,div 宽度关闭等)

我唯一能弄清楚的是它与我的手机/平板电脑是视网膜显示器有关,但我没有看到其他网站必须将其纳入计算...

现在真的很困惑,我会很感激任何帮助。谢谢

4

5 回答 5

2

把这个放在你的头上!!!:P

在元标记内。

name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

干杯,马克

于 2013-05-02T01:20:54.837 回答
1

你应该添加这个元

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

试试这个媒体查询iPhone 6/6 Plus 和 Apple Watch CSS媒体查询

@media only screen and (min-device-width: 375px)
 and (max-device-width: 667px)
 and (orientation: landscape)
 and (-webkit-min-device-pixel-ratio: 2)
 { }

iPhone 6 纵向

@media only screen
and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 2)
{ }

iPhone 6 Plus 横向

@media only screen
and (min-device-width: 414px)
and (max-device-width: 736px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 3)
{ }

iPhone 6 Plus 肖像

 @media only screen 
and (min-device-width: 414px) 
and (max-device-width: 736px) 
and (orientation: portrait) 

和 (-webkit-min-device-pixel-ratio: 3) { }

iPhone 6 和 6 Plus

  @media only screen
  and (max-device-width: 640px),
  only screen and (max-device-width: 667px),
  only screen and (max-width: 480px)
   { }

苹果手表

  @media
  (max-device-width: 42mm)
   and (min-device-width: 38mm)
  { }

对于图像响应

img {

   max-width: 100%;
  }
于 2016-04-26T05:08:33.180 回答
0

更新

昨晚我工作时,我的网络主机服务器崩溃了,我认为这影响了文件的正确传播......今天所有的响应代码都运行良好。

于 2013-04-11T19:22:48.070 回答
0

尝试在未正确显示的元素周围添加彩色 css 边框,border:thin red solid;或更改background-color以找出是否正在使用 css 选择器。此外,如果您放入页面链接并指出您遇到问题的元素以及您正在测试的设备/设备浏览器,这将很有用。

于 2013-04-11T10:43:28.363 回答
0

这个 wordpress 主题 Avando 已经响应:

http://themefurnace.com/themes/?theme=Avando

你不需要创建一些额外的 CSS

于 2013-04-11T08:39:23.710 回答