Hello
I found a strange behavior with streamlit. Maybe it’s not a bug, but a feature, but I have some difficulties to understand why…
Here is a small example (I found this on a large example)
import streamlit as st
# footer
footer = """<style> .footer {
position: fixed; left: 0; bottom: 0; width: 100%; background-color: white; color: black; text-align: center;
}
</style>
<div class="footer">
This is a test
</div>
"""
st.markdown(footer, unsafe_allow_html=True)
It put a footer on the bottom of the page (using html)
If I change it and put it on a function:
import streamlit as st
def main():
# footer
footer = """<style> .footer {
position: fixed; left: 0; bottom: 0; width: 100%; background-color: white; color: black; text-align: center;
}
</style>
<div class="footer">
This is a test
</div>
"""
st.markdown(footer, unsafe_allow_html=True)
main()
Then, the behavior is not the same, and the html is not processed…
Any idea why the behavior is not the same ???
(This is a very simple example. In my real life code, I did not write things like that, but some parts of the streamlit code are put in function, and it produces the same strange behavior)
Thank you !
Thibault