我尝试删除桌面滚动,但继续滚动手机和平板电脑。谁能告诉我为什么下面的代码不起作用?
/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) {
body {
overflow-y:visible;
}
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) {
body {
overflow-y:visible;
}
}
/* Large devices (large desktops, 1200px and up) */
@media (min-width: @screen-lg-min) {
body {
overflow-y:hidden;
}
}
答案 0 :(得分:0)
由于您已经知道了媒体查询的断点,为什么不在PX中进行媒体查询,而不是像http://jsfiddle.net/96q3u6ne/
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px){
body {
overflow-y:visible;
}
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
body {
overflow-y:visible;
}
}
/* Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
body {
overflow-y:hidden;
}
}