Hi, is there any way to change the font and background color, and opacity of st.success ? Because anything doesn’t seem with default colors.
the community or our support engineers for answers to questions.
Hi, is there any way to change the font and background color, and opacity of st.success ? Because anything doesn’t seem with default colors.
Hi @murat_tasci , maybe you can use st.markdown and styles to write your own st.success, thereby deciding all the cosmetic parameters of the output (font, colour, etc.)
Just search the same on the forum.
Cheers
Hi @Shawn_Pereira , I tried the below code in the function : (some parts are missing like multi-select, date input, button, etc. but the main structure is as follows.) The code works but it affects the background color of the footer of my web application, button section, and multi-select sections’ background color too. How can I solve this? I only want to change st.success’s background color.
import streamlit as st
def main():
with st.container():
st.markdown('''
<style>
.element-container {
background-color: blue;
opacity: 1;
}
.st-b7 {
color: white;
}
.css-nlntq9 {
font-family: Source Sans Pro;
}
</style>
''', unsafe_allow_html=True)
st.success('...')
if __name__=='__main__':
main()
I don’t know why this happens:
Hi @murat_tasci
Since I get copy-paste errors here, I have uploaded a pix of the code and the result for a st.success kind of display. Please change the parameters as desired.
Here you go:
Cheers
Thank you for your help.
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.