I just wanted to test in a simple app how to use a background image as my app’s main form.
What I’ve tried and what’s not working:
I followed several posted messages in this Q&A forum viz:
Here are the steps that I followed:
I uploaded a simple jpg image to the Asset of Anvil’s test app.
I created a Form using the Custom HTML design and then put the following codes on the custom.html asset.
<style>
body {
background-image: url("_/theme/corn.jpg")
background-repeat: no-repeat
}
</style>
I then looked in the property for custom html, clicked the pencil icon, got a prompt to insert the above codes in a specific section of the Form. The following codes got inserted in the Form:
I then tested the app but the corn.jpg image would not appear in my Form.
I tried to modify the body element - with and without the dot - same result-- the image would not display
Basically, I followed everything to the letter except changing the image to “corn.jpg”.
Any thoughts why?
Would greatly appreciate help.
Thank you.
Code Sample:
# this is a formatted code snippet.
# paste your code between ```