Cover entire page

Hi Team
using st.set_page_config(layout="wide") still doesn’t cover the entire page. There seem to be some margins. I actually want to avoid that.

Regards
labs

You can insert some custom CSS into your application to get rid of those margins. For example, to have 0 margin left or right, you can use the following code:

margins_css = """
    <style>
        .main > div {
            padding-left: 0rem;
            padding-right: 0rem;
        }
    </style>
"""

st.markdown(margins_css, unsafe_allow_html=True)

The default value is 5rem, so feel free to adjust the 0s in the code snippet above to whatever you want.

Good luck!

1 Like

This seems to work on only the padding left and right. I also notice component are embedded as an iframe. I am trying to style a navbar that will be on top of the page.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.