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
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 0
s in the code snippet above to whatever you want.
Good luck!
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.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.