在1200px的设备中,我可以将容器大小更改为960px,但我的笔记本电脑有1920px.*的全高清屏幕和
.container {
max-width: 960px!important;
}
不适用于我的笔记本
有人知道该怎么办吗?
尝试一下:
@media only screen and (max-width: 1920px) {
.container {
max-width: 960px !important;
}
}
还要检查以确保没有其他css文件的@media-styles取消了这个文件。例如:
<link href="stylesheet_1.css" />
<link href="stylesheet_2.css" />
如果stylesheet_1.css
中有.container { max-width: 960px!important; }
,请确保在stylesheet_2.css
中没有类似.container { max-width: 1170px!important; }
的东西将其取消。它发生了。
这种方式也是正确的
.ccontainer{最大宽度:960px;}
p.S我的问题是我的浏览器,我重新安装了它,一切都正常感谢您的帮助;)