【发布时间】: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