Backgroundcolor Dash

That is because by default, the browser use a style sheet to apply to every page. Include this somewhere in your css.

body { margin: 0; }

To include in dash, put that in a css file in folder named static at the root of you project.

import dash
app = dash.Dash('root-dir-name')  # the name of the folder containing your code and static folder.
app.css.append_css({'external_url': '/static/reset.css'})
app.server.static_folder = 'static'  # if you run app.py from 'root-dir-name' you don't need to specify.
# ... rest of code
2 Likes