Adding background images to a page

Hi,

I would like to add a background image to a specific section of the dash page I have. Is there a way to do this? I know you can add an image using html.Img, but haven’t found a way to make it a background image that ideally covers the whole width.

Thanks in advance!

Hello @tw5052,

Welcome to the community!

There are a couple of ways to do this, all of it includes css styling:

  • You can use a css stylesheet to set the background image of the target div:
    CSS background-image property

  • You can import an html.Img and then set its style style={'position':'absolute','width':'100%', 'height':'100%', 'zIndex':'-1'}