I tried to position div absolute to its parent. See chart1.
I set left and top properties, but the div is still positioned to root element, not its parent element dashboard.
What am I missing here, please?
#nav {
width: 200px;
min-height: 500px;
border: 2px solid gray;
display: inline-block;
}
#chart1 {
position: absolute;
top: 20px;
left: 100px;
width: 250px;
height: 450px;
border: 1px solid black;
}
#chart2 {
position: absolute;
top: 20px;
left: 450px;
width: 250px;
height: 450px;
border: 1px solid black;
}
<div id="nav"></div>
<div id="dashboard">
<div id="chart1">Chart 1</div>
<div id="chart2">Chart 2</div>
</div>