使用 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 建立儀表板