在 Dash (Python) Div HTML 组件周围添加边框
Add border around Div HTML component in Dash (Python)
我只是想使用 Python 在 Dash 中的 html.Div 组件周围添加边框。我试过类似的东西:
html.Div(children=[...], style={"border":"2px")
或
html.Div(children=[...], style={"border":{"width":"2px", "color":"black"})
但它似乎不起作用。有人可以帮忙吗?
谢谢
html.Div(children=[...], style={"border":"2px black solid"})
The border property is a shorthand property for the following individual border properties:
border-width
border-style (required)
border-color
更好的方法是使用css classes
html.Div(children=[...], className='divBorder')
然后添加一个cssclass
.divBorder{
border: 2px solid black;
}
我只是想使用 Python 在 Dash 中的 html.Div 组件周围添加边框。我试过类似的东西:
html.Div(children=[...], style={"border":"2px")
或
html.Div(children=[...], style={"border":{"width":"2px", "color":"black"})
但它似乎不起作用。有人可以帮忙吗?
谢谢
html.Div(children=[...], style={"border":"2px black solid"})
The border property is a shorthand property for the following individual border properties:
border-width
border-style (required)
border-color
更好的方法是使用css classes
html.Div(children=[...], className='divBorder')
然后添加一个cssclass
.divBorder{
border: 2px solid black;
}