Construindo Dashboards com Dash e Plotly
Alex Scriven
Data Scientist
$$
A maioria dos sites tem arquivos CSS;
style
CSS também pode ser usado em um elemento HTML
style da tag"property:value; property:value;"

<h1>Welcome to the website!</h1>
<h2 style="font-size:50px;color:red">
Enjoy your stay!
</h2>

Podemos editar CSS em um site ao vivo

Argumento style dos componentes Dash
Código anterior em um componente Dash:
app.layout = [
html.H1('Welcome to the website!'),
html.H2('Text',
style={'font-size':'50px',
'color':'red'})
]
CSS pode definir:
background-color)color)
Ambos aceitam strings (ex.: 'red') ou códigos RGB (ex.: 'rgb(0,0,255)' é azul)

CSS define o tamanho com width e height
app.layout = [
# Add & resize the company logo
html.Img(src=logo_link,
style={'width':'250px', 'height':'250px'})
]
app.layout = [
# Add & resize the company logo
html.Img(src=logo_link,
style={'width':'50%', 'height':'50%'})
]
Construindo Dashboards com Dash e Plotly