我想对最大宽度使用媒体查询。它在 Chrome 上运行良好,但在 Firefox 上却不行,为什么?
CSS
.box {
width: 150px;
height: 150px;
background-color: blue;
}
@media screen and(max-width: 400px){
.box {
background-color: red;
}
}
最佳答案
你的语法有误,and(max-width)之间需要一个空格
见下文
@media screen and (max-width: 400px){
.box {
background-color: red;
}
}
关于html - 媒体查询最大宽度在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16866595/