Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide div depending on horizontal browserviewport

I use Twitter's Bootstrap 2 with fluid-layout (responsive design) and want to hide a div-box if the browser's horizontal size is smaller than 800px.

How can i make it?

like image 619
StandardNerd Avatar asked May 09 '12 09:05

StandardNerd


1 Answers

You can apply a custom class to the element you wish to hide and add a display:none property to it to hide it inside a @media query that targets the width of your choice, like so:

@media (max-width: 800px) {
    .hidden-800 {
        display:none !important;
    }
}

Just make sure to place the @media query way down at the end of your custom stylesheet.

like image 191
Andres Ilich Avatar answered Sep 28 '22 06:09

Andres Ilich