0

I want to hide a div on all devices with a screen resolution that is less than 1024. This is the div that adds the space after 3 images:

<div class="page-banners clearer">&nbsp;</div>

And this is the page:

http://m.theseolounge.co.uk/

and this is the code I am using:

@media only screen and (max-device-width :1024px)
 {
 .page-banners
 {
  display: none !important;
 }
}

What am I doing wrong?

Shakamal
  • 87
  • 2
  • 10

1 Answers1

2

Make sure you have a <meta> viewport tag in the <head>:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Don't use !important for the style, and use max-width instead of max-device-width, like this:

@media only screen and (max-width:1024px){
  .page-banners {
    display: none;
  }
}
James Douglas
  • 3,328
  • 2
  • 22
  • 43