I'm currently building a website that involves a chatbot, and in the chat message input, there's a black box behind it that is covering part of my background image. Is there a way to remove it? I tried finding it at the devtools but it just wasn't working.
Here's the code I'm using for that
#import packages
from dotenv import load_dotenv
import openai
import streamlit as st
@st.cache_data
def get_response(user_prompt):
response = client.responses.create(
model = "gpt-4o", #Selects the model that you want to use (use the cheap one)
input = [ #List that keeps track of convo history as a list
{"role" : "user", "content": user_prompt} #Prompt
],
temperature = 0.7, #How creative the answer will get
max_output_tokens = 100 #Limit response length
)
return response
#Load enviroment variables from the .env file
load_dotenv()
#Initialize the OpenAI Client
client = openai.OpenAI()
title = st.empty()
subtitle = st.empty()
title.markdown("<h1 style='text-align: center;'>Hello There!</h1>", unsafe_allow_html=True)
subtitle.markdown("<h2 style='text-align: center; '>How can we help you?</h2>", unsafe_allow_html=True)
page_bg_image = """
<style>
[data-testid="stAppViewContainer"] {
background-image: url('https://snu.edu.in/site/assets/files/18543/gears-technological-elements-digital-blue-background-symbolizing-network-innovation-communication-3d-rendering.1600x0.webp');
background-size: cover;
}
[data-testid="stHeader"]{
background-color: rgba(0,0,0,0);
}
[data-testid="stBottomBlockContainer"] {
background: rgba(0,0,0,0);
}
</style>
"""
st.markdown(page_bg_image, unsafe_allow_html=True)
#Add a text input box for the user prompt
user_prompt = st.chat_input("Enter your prompt: ")
if user_prompt:
title.empty()
subtitle.empty()
st.chat_message("user").write(user_prompt)
with st.spinner("Generating response..."):
response = get_response(user_prompt)
#Print the response
st.chat_message("assistant").write(response.output[0].content[0].text)


<div>betweenstBottomandstBottomBlockContainerwhich has color and you have to use[data-testid="stBottom"] > div {...}instead of[data-testid="stBottomBlockContainer"] {...}.stBottom > div {...}