Bootstrap - 在纵向方向上隐藏元素并在风景上显示

Mat*_*t42 3 html css twitter-bootstrap

我想在纵向方向上隐藏移动设备上的图像,但在横向上显示.

Bootstrap如何实现?

谢谢 :)

小智 6

Bootstrap没有基于方向的类.但你可以在css中使用媒体查询自己编写.

@media (orientation:landscape) {
    .hide-on-landscape {
        display: none;
    }
}

@media (orientation:portrait) {
    .hide-on-portrait {
        display: none;
    }
}
Run Code Online (Sandbox Code Playgroud)