mediaqueries最大宽度在Firefox中不起作用 [英] mediaqueries max-width not working in firefox
本文介绍了mediaqueries最大宽度在Firefox中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用mediaquerie作为最大宽度。它适用于Chrome,但在Firefox中却没有,为什么?
CSS
.box {
width:150px;
height:150px;
background-color:blue;
}
@media screen和(max-width:400px){
.box {
background-color:red;
$ / code $ / pre
解决方案语法错误,你需要和(max-width)之间的空格
见下面
@media screen and(max-width:400px){
.box {
background-color:red;
}
}
I want to use a mediaquerie for max-width. It works fine with Chrome but in Firefox it does not, why?
CSS
.box {
width: 150px;
height: 150px;
background-color: blue;
}
@media screen and(max-width: 400px){
.box {
background-color: red;
}
}
解决方案 Your syntax is wrong, you need a space between and(max-width)
See below
@media screen and (max-width: 400px){
.box {
background-color: red;
}
}
这篇关于mediaqueries最大宽度在Firefox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文