手機橫屏時候提示請豎屏瀏覽純css實現


//今天無意間瀏覽nike公眾號看到的 最近也正在做着就記錄下來備忘
<!
DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .nike-portrait-screen { text-align: center; } @media screen and (max-aspect-ratio: 13 / 9) { .nike-portrait-screen { display: none; } .nike-landscape-screen { height: 100%; width: 100%; display: block; } } @media screen and (min-aspect-ratio: 13 / 9) { .nike-portrait-screen { display: block; } body { height: 0 !important; background-color: transparent !important; } .nike-landscape-screen { display: none; } } </style> </head> <body> <div class="nike-portrait-screen"> <img src="images/landscape-image-2.gif" alt=""> <div class="content-img"> <img src="images/landscape-text.gif" alt=""> </div> </div> </body> </html>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM