How to add Background Image #623
Unanswered
StarsExpress
asked this question in
Q&A
Replies: 1 comment
-
PyWebIO didn't provide exact api to add background image. However pywebio provide api to run js code ( var body = document.getElementsByTagName('body')[0];
body.style.backgroundImage = 'url(https://interactive-examples.mdn.mozilla.net/media/examples/lizard.png)'; So, in pywebio, you can use the following code to add background image: from pywebio.session import run_js
def main():
run_js("var body = document.getElementsByTagName('body')[0]; body.style.backgroundImage = 'url(https://interactive-examples.mdn.mozilla.net/media/examples/lizard.png)';")
start_server(main, ...) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Do we have some ways to add background image?
Beta Was this translation helpful? Give feedback.
All reactions