Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap - hide element on portrait orientation and show on landscape

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

How it is possible with Bootstrap ?

Thanks :)

like image 426
Matt42 Avatar asked Nov 14 '16 09:11

Matt42


1 Answers

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;
    }
}
like image 146
emtei Avatar answered Sep 20 '22 13:09

emtei