Matt42
Matt42

Reputation: 71

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 :)

Upvotes: 6

Views: 6280

Answers (1)

emtei
emtei

Reputation: 631

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;
    }
}

Upvotes: 10

Related Questions