I'm attempting to create a page that fills the entire height of the screen without adding an undesirable scrollbar. When I say 100% height, I mean it should just fit the size of the screen.
Here is a demonstration of the issue. The yellow highlighted area represents the unwanted added height, and there is also a horizontal scrollbar present:
https://i.stack.imgur.com/yz07O.png
Below is the code snippet for rendering the page:
return (
<>
<Box display='flex' flex='1' justifyContent='space-around'>
<IndexSelector
id='index'
value={symbol}
onChange={this.onSymbolChange}/>
<SeriesSelector
id='series'
seriesList={Form.seriesList}
onChange={this.onSeriesChange}/>
<DateRange fromDate={fromDate} toDate={toDate} onChange={this.onDateChange}/>
</Box>
<Box height='100%' border='1px solid red' marginTop='50px'>
<Graph instructions={this.getInstructions()} apiData={this.apiData} />
</Box>
</>
)
The following CSS is used in index.css:
html {
box-sizing: border-box;
}
html, body, #root {
padding: 0px !important;;
margin: 0px !important;;
height: 100vh;
width: 100vw;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
Any suggestions on how to eliminate the extra height and width, and ensure the red-bordered container fills the full height?
EDIT: I followed @gowatham's suggestion but didn't achieve the desired outcome. Here's what I got:
EDIT 2:
HTML: https://pastebin.com/Qu2RFHe7 CSS: https://pastebin.com/1z3Zg5rv