Hide a Drupal block on mobile devices

782 Views Asked by At

I'm making a new Drupal site which is based on a non-bootstrap theme and makes heavy use of blocks to place content. Some blocks display content that is better to hide on smaller screens to have a nicer look and feel. I want to hide them, but I don't know how to do it. I'm using Drupal 9. I understand that there are some modules that can help in this situation, but those I know don't work with D9.

1

There are 1 best solutions below

0
C.A. Vuyk On

Why use modules when CSS will do, something like

@media only screen and (max-width: 600px) {
  .blockname {
    display: none;
 }
}