stop scroll css code example

Example 1: disable scroll css

/* Answer to: "disable scroll css" */

/*
  You must set the height and overflow of the body, to disable
  scrolling.
*/

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden
}

Example 2: css stop scrollbar

html {
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

html::-webkit-scrollbar {
    width: 0px; /* For Chrome, Safari, and Opera */
}

Example 3: css prevent background scrolling

<body scroll="no" ></body>

or css

background-attachment: fixed;

Tags:

Css Example