简体   繁体   中英

Remove border around page

I have this weird border around my entire page:

This is my App.js. The Home component has just ThemeProvider wrapper, and then everything is inside Paper component.

class App extends Component {
  render() {
    
    return (
      <ThemeProvider theme={theme}>
         <div>
          <NavBar></NavBar>
        </div>
        <Home></Home>
      </ThemeProvider>   
    );
  }
}
export default App;

Most browsers have a default user-agent stylesheet where some default styles are applied. You want to explicitly set body 's margin and padding to 0px:

body {
    margin: 0px;
    padding: 0px;
}

@khuynh has the right idea, however I'd suggest following Material-UI's recommendation to wrap your app in the CSSBaseline component instead of manually attempting to provide your own browser resets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM