当屏幕尺寸大于 1024 像素时,我想在我的网站中添加边框和背景。
我在我的代码中使用了这个:
(max-width: 1024) { background-image: url("Gutter.png"), url(Background.png);
background-position: left, center;
}
但即使在大于 1024 像素的屏幕中也只会出现背景。
最佳答案
媒体查询的正确格式如下:
@media all and (max-width:1024px) {
#selector {
background-image: ...;
background-position: ...;
}
}
关于html - 当尺寸大于 1024 像素时如何更改背景(添加边框),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18234595/