r4i*_*id4 3 css reactjs material-ui
我有我的App.js类呈现为
const theme = createMuiTheme({
palette: {
primary: lime,
secondary: {
...grey,
A400: '#00e677'
},
error: red
}
});
class App extends Component {
render() {
const classes = this.props.classes;
return (
<div className={classes.root}>
<MuiThemeProvider theme={theme}>
<MyApp/>
</MuiThemeProvider>
</div>
);
}
}
export default withStyles(styles)(App);
Run Code Online (Sandbox Code Playgroud)
我的根类有这种风格
const styles = theme => ({
root: {
width: '100%',
height: '100%',
marginTop: 0,
zIndex: 1,
overflow: 'hidden',
backgroundColor: theme.palette.background.default,
}
});
Run Code Online (Sandbox Code Playgroud)
我认为通过设置height:'100%'我已经填满了所有窗口,问题是我MyApp的div 下面有一个空白区域(灰色背景),见附图.
如何强制背景颜色填充100%的窗口?
| 归档时间: |
|
| 查看次数: |
2251 次 |
| 最近记录: |