Prevent orientation change in iOS Safari

前端 未结 9 1524
死守一世寂寞
死守一世寂寞 2020-11-28 02:56

Is it possible to avoid transition to landscape view in Safari for iOS when the device is rotated?

iOS Safari has the \"orentationchange\" event, I tried to intercep

9条回答
  •  無奈伤痛
    2020-11-28 03:39

    I test this way work for me:

    @media (orientation: portrait) {
      body {
        transform: rotate(-90deg);
      }
    }
    

提交回复
热议问题