Dash background image

Hi All,

i am currently using this code to have background image but the output is comming wrong i dont get full image as background as in pic uploaded u can see white space below.tried the same with backgroundcolor but its the same issue.

app.layout = html.Div([
dcc.Location(id=‘url’,refresh=False),
html.Div(id=‘intermediate-div’,style={‘display’:“none”}),
html.Div(id=‘custom-auth-frame’),

    ],style={"background-image": 'url("/assets/Background.PNG")'})

Any help i can get??.

If you are using .css file you can set the background like this to ensure if covers entirely:

html {
  height: 100%;
  ... }
body{
  height:100%;
  background-image: url("/assets/Background.PNG");
  background-size: cover;
  background-position: center;
  ...}
1 Like

Hi caiyij i am using codepen and its not working.