gpt4 book ai didi

html - Internet Explorer 媒体查询在不应生效时生效

转载 作者:太空宇宙 更新时间:2023-11-04 12:10:53 26 4
gpt4 key购买 nike

我有以下 CSS:

@media all and (max-width: 500px){
.calendar_head{
height: 120px;
line-height: 60px;
}
}
.calendar_head{
width: 100%;
font-weight: 700;
color: #6a7783;
text-align: center;
line-height: 30px;
}

在 Internet Explorer 11(可能还有其他版本)中,首次加载页面时,无论视口(viewport)宽度如何,媒体查询都会生效。只有当页面调整大小时,它才意识到媒体查询不应该生效。

最佳答案

尝试将媒体查询放在正常类状态之后。另外,您也可以尝试为非媒体查询指定一个高度。

.calendar_head{
width: 100%;
font-weight: 700;
color: #6a7783;
text-align: center;
line-height: 30px;
height: auto;
}
@media all and (max-width: 500px){
.calendar_head{
height: 120px;
line-height: 60px;
}
}

关于html - Internet Explorer 媒体查询在不应生效时生效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29051695/

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