I cannot add properly the CSS style to my Dash App.
I want to create a Dashboard with a side bar on the left and on the right a top bar with some metrics and the plots below, like this:
So, in my App.py file I have:
app = dash.Dash()
app.layout = html.Div(
className="content",
children=[
html.Div(
className="left_menu",
children=[
html.Div(
'This is the left menu'
),
]
),
html.Div(
className="right_content",
children=[
html.Div(
className="top_metrics",
children=[
'This is top metrics'
]
),
html.Div(
'This down top metrics'
),
]
),
if __name__ == '__main__':
app.run_server(debug=True)
And the css file:
.content{
width: 100%;
background: #F7F7F7;
}
.right_content{
width:85%;
position:absolute;
top: 0;
right: 0;
}
.top_metrics {
background: #EAEAEA;
height: 200px;
width:85%;
position:absolute;
top: 0;
right: 0;
}
.left_menu {
width: 15%;
position: absolute;
top: 0;
left: 0;
height: 100vh;
z-index: 999;
background: #2A3F54;
}
However, I get this:
I do not understand why "This down top metrics" appears there and not below "top metrics"