响应 css 不工作

Responsive css is not working

我正在为

的设备分辨率单独编写 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。 我如何写 css 可以在 360px*640(orientation:portrait) 设备上工作。

试试这个:

@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
}