Bygg dashboards med Dash och Plotly
Alex Scriven
Data Scientist
"Box model" behandlar varje HTML-element som en box med lager:
height & width)
CSS-argumentet border tar tre element:
'border':'A B C'solid eller dotted)red)
dcc.Graph(figure=ecom_bar,
style={'width':'500px',
'height':'450px',
'border':'5px dotted red'}
)

Så här anger du avstånd för ett HTML-element:
T.ex. 'padding':'10px 5px 5px 15px'
$$

Utan padding:

Med 'padding':'100px':

Utan margin:

Med margin: 100px auto:

Med: 'margin':'100px'

Med: 'margin':'100px auto'

Element som inte radar upp sig? HTML-element är antingen 'inline'- eller 'block'-element.
$$
<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>
$$

Bygg dashboards med Dash och Plotly