S
Solara12mo ago
Altier

Hi I’ve been trying to add background

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!
5 Replies
MaartenBreddels
MaartenBreddels12mo ago
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?
Altier
Altier12mo ago
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
Altier
Altier12mo ago
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
Altier
Altier12mo ago
thanks so much for your help in advance! @MaartenBreddels
MaartenBreddels
MaartenBreddels12mo ago
I don’t see where you set the hero class on an element, where do you do that?