Mobile site - force landscape only / no auto-rotate

后端 未结 5 2231
梦如初夏
梦如初夏 2020-11-27 16:53

I have a site that has a mobile stylesheet:


I\'m also using jQue

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 17:04

    Simple way to force landscape orientation is set your min-max width in your css code, try using this code

    @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:portrait) { 
    body {
    -webkit-transform: rotate(90deg);
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0; 
    }}
    

    hope solve your problem.

提交回复
热议问题