Bootstrap - 在纵向上隐藏元素并在横向上显示 [英] Bootstrap - hide element on portrait orientation and show on landscape

查看:78
本文介绍了Bootstrap - 在纵向上隐藏元素并在横向上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Bootstrap如何实现?



感谢:)

解决方案

Bootstrap没有基于方向的类。但您可以使用媒体查询自行编写它们在css中。

  @media(orientation:landscape){
.hide-on-landscape {
显示:无;


$ b $ media(orientation:portrait){
.hide-on-portrait {
display:none;
}
}


I want to hide images on mobile devices in portrait orientation but show on landscape.

How it is possible with Bootstrap ?

Thanks :)

解决方案

Bootstrap don't have orientation based classes. But you can simply write them yourself using media queries in css.

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

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

这篇关于Bootstrap - 在纵向上隐藏元素并在横向上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆