How to block scrollbar when browsing a desktop device?

Asked

Viewed 95 times

0

I am using Bootstrap 4. How to block the 'scrollbar' (the scroll sidebar) when navigating on an appliance desktop?

  • Do you want to know if you’re on a real "desktop" or to know by the screen resolution? By screen resolution is difficult because there are high resolution tablets and smartphones.

1 answer

0

You can use media-queries to remove the scrollbar. In the example below, we filter the media type screen and the width min-width to characterize a Desktop.

This allows us to remove the scroll considering only for the selected features.

    /* Medium Devices, Desktops */
    @media only screen and (min-width : 992px) {
      html {
             overflow: hidden;
           }
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.