我在移动设备上遇到显示属性问题。显示:无根本不起作用。我正在使用SASS。这是我的代码:
main {
display: none;
}
@media(min-width: $mobile-breakpoint) {
main {
height: 800px;
display: flex;
background-color: inherit;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-attachment: fixed;
background-image: url("./images/main.jpg");
}
}
最佳答案
在移动断点内使用display: none
。
示例:
@media(min-width: $mobile-breakpoint) {
main {
height: 800px;
display: none;
background-color: inherit;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-attachment: fixed;
background-image: url("./images/main.jpg");
}
}
关于css - 显示 : none doesn't work on mobile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49334741/