响应式CSS不起作用

时间:2016-07-18 12:45:43

标签: css css3 responsive-design media-queries

我正在使用

单独编写用于设备解析的css

@media only screen and (min-width: 320px) and (max-width: 480px) and (orientation: portrait) { // css goes here }

的设备分辨率

@media only screen and (min-width: 360px) and (max-width: 640px) and (orientation: portrait) { // css goes here }

360px*640(orientation:portrait) css不起作用。它采用默认的320px * 480px CSS。 我如何编写适用于360px*640(orientation:portrait)设备的css。

1 个答案:

答案 0 :(得分:1)

试试这个:

@media only screen 
  and (min-width: 320px)
  and (max-width: 360px) 
  and (orientation: portrait) {
  // 360px width goes here
}

@media only screen 
  and (max-width: 320px) 
  and (orientation: portrait) {
  // 320px width goes here
}