html {
margin: 0;
padding: 0;
background-image: url("./Images/mainPage.png");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
}
@media only screen and (max-width: 750px) {
html {
background-image: url("./Images/smalMainPage.png");
}
}
不带“ @media only ...”的部件在屏幕尺寸小于750px的设备上工作。为什么会这样?
答案 0 :(得分:1)
<meta name="viewport" content="width=device-width, initial-scale=1.0">
标签可能会丢失?因为正在使用Codepen:https://codepen.io/dgknca/pen/REwKrV