gpt4 book ai didi

html - 媒体查询最小宽度不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 22:55:48 25 4
gpt4 key购买 nike

我有两个媒体查询。

@media (min-width: 1300px) {
.container {
width: auto;
max-width: 1360px;
}
}
@media (min-width: 1565px) {
.container {
width: auto;
max-width: 1576px;
}
}

无论宽度是多少。容器始终作为第一个媒体查询。 我的意思是,当 body 的宽度为 1570px 时,容器宽度仍然为 1360px!

最佳答案

设置 viewport 很重要在 HTML 中 <head> .

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

关于html - 媒体查询最小宽度不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38478917/

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