Building the menu and adding decorations
NLP Web App might be a good title for our application, but to be honest, it’s just some black text on a white background, so it’s not very appealing at the moment.
One of the greatest features of Streamlit is that we can use HTML very easily. So, let’s add some simple HTML code to our main
function just to make everything much more stylish! We can change the old st.title("NLP Web App")
first line of code that sits after the main function declaration with the following one:
Figure 4.16: Adding some HTML to our title
In title_template
, we are specifying the background color (blue), the padding size, and the text style (h1) and its color (cyan). With the st.markdown
instruction, as we learned previously, we are just visualizing the HTML; you can play around and customize it as you want by changing the background and text color, padding, text, and more. This is the result: