gpt4 book ai didi

css - 只有一个 CSS 媒体查询有效

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

我正在使用 CSS @media 根据屏幕分辨率调整我的网站无论我切换到高度为 768 还是 720 的分辨率,它仍然会像我的屏幕分辨率具有 720 像素的高度一样

.group-container{
min-width:1210px;
max-width:70000px;
width:1210px;
margin-left:2.5%;
height:87%;
margin-top:1%;
}

@media only screen and (max-height: 768px) {
.group-container{
margin-top:150px;
}
}

@media only screen and (max-height: 720px) {
.group-container{
margin-top:3px;
height:90%;
}
}

最佳答案

对于第一个媒体查询,您还应该使用 min-height 设置为 720px 和 max-height 设置为 768px

关于css - 只有一个 CSS 媒体查询有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33003945/

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