有没有办法改变st.success的字体、背景色和透明度?因为任何东西看起来都不是默认的颜色。这里有一个问题的视觉:
发布于 2022-05-19 15:34:52
txt="text here"
htmlstr1=f"""<p style='background-color:green;
color:white;
font-size:18px;
border-radius:3px;
line-height:60px;
padding-left:17px;
opacity:0.6'>
{txt}</style>
<br></p>"""
st.markdown(htmlstr1,unsafe_allow_html=True)
这是一种方法。它不会影响我代码中的任何地方。
发布于 2022-05-16 00:19:04
import streamlit as st
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('Whoever is happy will make others happy too. -Anne Frank')
https://stackoverflow.com/questions/72248555
复制相似问题