S
Solara

general

Hi I’ve been trying to add background

AAltier6/28/2023
Hi. I’ve been trying to add background image to my page. I created a CSS.py script which contain a tag that has background-image specified. I then add the CSS variable in solara.Style. However, the background-image just doesn’t load. All the rest of the CSS I defined in the script works except for the background image. Wonder if anyone has any idea on this. Thanks!
MMaartenBreddels6/28/2023
can you share more details, where did you store the image, and what is the css, and do you see errors in the dev console?
AAltier7/6/2023
hi thank for the reply. This is a screenshot of my current app page which i wanted to add a hero background image to it. i added a solara.style(CSS_Style) which looks like this. i tried a few method for the background-image (either using website or local directory picture) but both still doesnt display any background image
No description
No description
No description
AAltier7/6/2023
by the way, also if i were to try to use background color, why is there padding around the blue as shown from the pic.
No description
No description
AAltier7/7/2023
thanks so much for your help in advance! @MaartenBreddels
MMaartenBreddels7/8/2023
I don’t see where you set the hero class on an element, where do you do that?

Looking for more? Join the community!