I'm trying to set a background image in React but it only covers about 75% of the height.
It seems that the component doesn't take up all of the height.
What's the solution?
In index.js:
ReactDOM.render(<Login />, document.getElementById('root'));
In index.css:
html, body, .Login-component {
height: 100%;
}
In Login.js:
render() {
return (
<div className='Login-component'>
);
}
In Login.css
.Login-component {
background: url(../static/login-bg.jpg) no-repeat center center fixed;
background-size: cover;
}
The end result: Screen shot