Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Centering a plot and widget in dash

Is there a simple way to center a plot and its slider/dropdown menu?

style={'width': '48%', 'display': 'inline-block', 'float': ?}

Check out https://css-tricks.com/centering-css-complete-guide/

2 Likes

Thanks!

Here an example:

html.Div([dcc.Dropdown(id='select-month',
                         options=[{'label': i, 'value': i} for i in months], value='June')], 
                         className='container', style={'maxWidth': '650px'})