CSS translate X causes white space on right side of screen mobileAsk Question


I am using css translate to create a sidebar for my site. The problem is that after clicking the side bar, and collapsing it. It creates white space on the right hand side of the screen. This only happens on mobile devices.

This project is written on React JS so no jquery fixes.

enter image description here


This worked for me!

body, html {
  overflow-x: hidden; 


Edit: This seems to fix it for me:

html, body {
    width: 100vw;
    overflow-x: hidden;
标签: css reactjs safari
© 2014 TuiCode, Inc.