gpt4 book ai didi

html - 禁用移动设备的横向模式

转载 作者:行者123 更新时间:2023-11-28 16:38:26 25 4
gpt4 key购买 nike

你好,我用这个创建了一个响应式移动网站:

max-width(480px) {etc..} 

+

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

对于每个移动设备,网站看起来都一样 => 很棒。

但是当我更改为横向时,有超过 480 像素并且桌面显示的网站变体。

即使超过 480 像素,是否有可能禁用自动旋转或在移动设备上显示纵向模式?

问候

最佳答案

您可以尝试使用媒体查询定位特定方向:

@media max-width(600px) and (orientation: landscape) {
rules for landscaped devices...
}

关于媒体查询的更多信息:

https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

关于html - 禁用移动设备的横向模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24535361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com