【问题标题】:Responsive design on iPhone 6?iPhone 6 的响应式设计?
【发布时间】:2017-12-22 17:25:37
【问题描述】:

我在 iPhone 6 上的响应式设计遇到问题。在桌面上,css 可以正常工作,媒体查询似乎是正确的,但是当我将它放到服务器上并在手机上实际测试时,就好像什么都没发生。

我已经使用了元标记,这有助于它进入手机布局,但是文本、img 和按钮都不合适。

我的 CSS:

@media only screen and (max-width: 308px) and (orientation: portrait) {
  .jumbotron h2 {
    bottom: 3em;
  }
  .jumbotron img {
    bottom: -5em;
  }
  .jumbotron button {
    bottom: -1em;
  }
}

【问题讨论】:

  • head 部分中,您分配了viewport 代码??试试@media screen and (max-width: 308px) and (orientation: portrait)
  • 是的,我做了
  • 尝试@media screen and (max-width: 308px) and (orientation: portrait)删除only

标签: css iphone responsive-design


【解决方案1】:
max-width: 308px 

太小了

您可以在手机上跟踪引导大小 手机(

max-width:768px;

【讨论】:

  • 根据chrome,它是375。 768 是 iPad 的大小。
  • 反正
猜你喜欢
  • 1970-01-01
  • 2016-04-30
  • 2021-06-07
  • 1970-01-01
  • 1970-01-01
  • 2013-04-01
  • 1970-01-01
  • 2014-08-27
  • 2014-11-09
相关资源
最近更新 更多