I have an empty container that I am trying to add a background image to using custom css, however it doesn't appear to take. I've tried adding !important to see if that helped, but it didn't. Why doesn't this CSS work? I found a similar post from a few years ago showing that this should work. Has anyone else been successful at this?
#retool-widget-container1 > div > div._K6paF > div > div > div > div > span > div > section > div > div > div {
background-image: url();
background-size: cover;
}
I'm not sure this is the right answer. This method only applies the background in the editor. That means when you're actually running the app, it wouldn't work.
I thought the entire point of Retool's CSS was so that you could refer to the object, as I have done. It also seems odd that it used to work, as we can see in the previous post that I linked. I'm thinking this is a bug.
Thats why Retool's Custom CSS is not recommended in all cases, selectors can change between versions, but you can search the selector when is in view mode
Please note , we strongly recommend using Retool's built-in style and theme options whenever possible. Class names and DOM structure may change as new features are added that could break custom CSS.