Skip to content

Instantly share code, notes, and snippets.

@alexdiliberto
Forked from davidgilbertson/block-scroll.css
Created February 15, 2017 00:29
Show Gist options
  • Save alexdiliberto/ae73edf77d4585ff1036352eed87abe4 to your computer and use it in GitHub Desktop.
Save alexdiliberto/ae73edf77d4585ff1036352eed87abe4 to your computer and use it in GitHub Desktop.
/* the page should not change width as content is loaded */
body {
overflow-y: scroll;
}
/* block scrolling without losing the scroll bar and shifting the page */
/* add this class when a modal is open */
body.block-scroll {
overflow: hidden;
overflow-y: scroll !important;
position: fixed;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment