.turn { position: absolute; width: 100%; height: 100%; left: 0; top: 0; background: url(../images.png) center center no-repeat #000; background-size: contain; display: none; z-index: 505; } @media ( orientation: landscape ) { .turn { display: block; } }
<!--如果是横屏或电脑打开,提示它换成手机竖屏。--> <div class="turn"></div>