使用 Dash 和 Plotly 构建仪表板
Alex Scriven
Data Scientist
"盒模型"将每个 HTML 元素视为带有多层的盒子:
height 和 width 属性)
border CSS 参数包含三部分:
'border':'A B C'solid、dotted)red)
dcc.Graph(figure=ecom_bar,
style={'width':'500px',
'height':'450px',
'border':'5px dotted red'}
)

设置 HTML 元素的间距:
例如:'padding':'10px 5px 5px 15px'
$$

无内边距:

添加 'padding':'100px':

无外边距:

添加 margin: 100px auto:

使用:'margin':'100px'

使用:'margin':'100px auto'

元素未对齐?HTML 元素可以是"inline"或"block"。
$$
<div style='width:50px;height:50px;
background-color:blue'></div>
<div style='width:50px;height:50px;
background-color:red
;display:inline-block'></div>
<div style='width:50px;height:50px;
background-color:green;
display:inline-block'></div>
$$

使用 Dash 和 Plotly 构建仪表板