SyntaxError: positional argument follows keyword argument

dbc.Col(html.Div(id='myid',[



                html.P('text'),
                html.H4('text2'),
                html.P("text3"),
                html.H4('text4')



            ]),width={'size':1,'offset':1})

I want to have one and the same ID for all the html components in this division to be able to change/replace the entire children of the html division that comes before them (id: myid)

When I try to run this I get: SyntaxError: positional argument follows keyword argument.

Typically when I have this error I have not put my components in “[” but this time i did it correctly in my opinion?

Can someone correct me please! :slight_smile:

Try this:

dbc.Col(
    html.Div(
        id='myid',
        children=[
            html.P('text'),
            html.H4('text2'),
            html.P("text3"),
            html.H4('text4')
        ],
    ),
    width={'size':1,'offset':1}
)

I believe children= is optional IF it is the 1st argument.

thank you it worked :slight_smile:

1 Like