Found a solution: add new CSS property overscroll-behavior-y: none;
See overscroll-behavior property
html {
margin: 0;
overscroll-behavior-y: none;
}
Original question:
Trying to prevent overscrolling in Chrome. I tried multiple solutions, but with no help. This is my html and body used (CSS):
* {
margin: 0;
padding: 0;
-webkit-box-sizing: border-box; /* width and height value includes content, padding and border not the margin */
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0,0,0,0); /* remove highlight on touch devices */
-webkit-tap-highlight-color: transparent;
-webkit-font-smoothing: antialiased;
-webkit-touch-callout: none; /* iOS Safari display callout information */
-webkit-text-size-adjust: 100%; /* prevent font scaling in landscape while allowing user zoom */
user-drag: none;
-webkit-user-drag: none; /* disable drag images */
}
html {
height: 100%;
overflow-y: scroll;
overflow-x: hidden !important;
}
body {
font-family: sans-serif;
font-weight: normal;
font-size: 1.25rem;
line-height: 1.1;
letter-spacing: 0.0125em;
text-align: left;
color: black;
min-height: 100%; /* for sticky footer */
display: flex; /* for sticky footer */
flex-direction: column; /* for sticky footer */
}
One idea i've tried was this answer 7 years ago, but it makes the scroll bar of the browser go behind the fixed header and looks weird.