Recently I faced an issue when my page scrolls down to the bottom istead of starting with no scoll. Due to this issue, I am not even able to see my name and avatar, as you can see in this video.
I searched for a possible solution but couldn’t find anything.
PS.: I looked at this similar issue (link to access) but it has no replies nor visible solution.
Each document should have a single st.title(), although this is not enforced.
The issue I think is that every st.write("#") in that app is interpreted as a st.markdown("#"), which is equivalent to adding an empty st.title(""), which is equivalent to an empty <h1> html tag. But there should be an unique title in the app as streamlit looks for that beginning.
In streamlit, the header levels follow something like:
Streamlit
HTML
Markdown
st.title
<h1>
#
st.header
<h2>
##
st.subheader
<h3>
###
Not sure why you’d need those empty title anchors (i.e., the st.write("#") before each section, maybe to add some vertical whitespace?) but removing them should fix your issue.
This problem is happening to me. I have an st.title at the start of my script, and a st.write(“##”) somewhere after, and the screen jumps to the ## at the start of every session. ## happens to be the near perfect amount of space for a button to line up with a text input with description text in an adjacent column, whereas is too much vertical space.
The explanation above kind of suggests that using ## and ### would be safe with st.title, but it seems that is not the case. Does anyone have any advice for what to do?
I tried replacing the st.title with st.write(“##”) but I don’t think that worked.
Hi!
Thanks, I could diagnose why this is happening in my site.
In my case though, I’m using a streamlit authenticator login form which probable uses a st.title, making my site scroll to the title when uploaded. Unfortunately my form is not placed at the top of my site, is there any workaround so I don’t have to move it to the top?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
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.
Performance cookies
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.
Functional cookies
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.
Targeting cookies
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.