我必须根据设备定义不同的文本区域高度:
- 如果用户使用的是 iPhone 4,则 textarea 的高度必须为
62px
, - 如果用户使用的是 iPhone 5,则 textarea 的高度必须为
106px
.
这是我当前的 CSS。它适用于 iPhone 5,但如果我在 iPhone 4上加载页面,它会使用为 iPhone 5定义的样式。
/* iPhone 2G-4S in portrait */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px)
and (orientation : portrait) {
textarea {
height: 62px;
}
}
/* iPhone 5 & 5S in portrait */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px)
and (orientation : portrait) {
textarea {
height: 106px;
}
}
为什么在 iPhone 4中加载的页面不使用该62px
值?