Styling dcc.Input

Hi,
I am trying to style an input area, but can’t seem to get it right.

html.Div([dcc.Input(id='id', value='', type='text',debounce = False , placeholder='input'), style={}], 
             style={'textAlign':'center'}),

No matter what I put inside {} for style, I get the following error:

SyntaxError: invalid syntax. Maybe you meant ‘==’ or ‘:=’ instead of ‘=’?

Sometimes a bit of formatting helps:

html.Div(
    children=[
        dcc.Input(
            id='id', 
            value='',
            type='text',
            debounce=False,
            placeholder='input',
            style={}
        )
    ],
    style={'textAlign': 'center'}
)
1 Like

Thanks. Found out the error after formatting. style={} was outside the brackets.