gpt4 book ai didi

css - 有没有办法让浏览器在设备模式下减少 "width"以及 "device-width"

转载 作者:行者123 更新时间:2023-11-28 15:10:15 27 4
gpt4 key购买 nike

当我在 chrome(以及 Edge/Brave/Opera)的设备模式下测试页面时,设备宽度属性似乎减少了,但宽度属性没有

重新创建:

<html>
<style>
html {
background-color: #EEE;
}
@media (min-width: 750px) {
html {
background-color: #BADC55;
}
}
</style>
<h1>Hello World!</h1>
</html>

按预期缩小窗口:

Small window

设备模式不会:

Device Mode

最佳答案

然后你必须将这一行添加到你的代码中

 <meta name="viewport" content="width=device-width, initial-scale=1.0">

关于css - 有没有办法让浏览器在设备模式下减少 "width"以及 "device-width",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48564497/

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