Create a folder called assets in the same directory as your app script, and put your image in there. Then change url("diginex.png") to url("/assets/diginex.png"). This worked when I tried it just now.
The reason is that Dash won’t serve just anything from your local filesystem (which is actually a good thing) so you have to tell it what it can serve up and where to look for those things. By default, Dash is configured to look for a folder called assets and serve up any images in there, so the easiest thing is to create the folder and save your images there.
Hello @tcbegley!
I am a beginner and I am stuck with the image issue on Dash. I need to upload an image as a background in the header and an image in the header as a logo at the centre. I used background: url("") function and I have been trying everything: I created a folder in Documents, Downloads, Desktop and I called assets but it doesn’t work. Where exactly the asset folder should be to be served by Dash? I am unable to use any image. PLEASE HELP!!!
I don’t think any of these answers have actually adressed one issue - the issue is when trying to load an image using the style keyword within the .py file, not the CSS.