https://discord.gg/botpress logo
Can't change chat width
# 🤝help
e
Hi everyone, I have tried to modify the CSS but chat width ain't changing at all. I'm using the webchat version. This is the CSS. I would like to make it 1/4 of the screen /* Your CSS styles here */ /* Estilos Generales */ * { box-sizing: border-box; } body { font-family: Arial, sans-serif; background-color: #f9f9f9; margin: 0; padding: 0; } /* Contenedor del Chatbot */ #chatbot-container { position: fixed; bottom: 20px; right: 20px; width: 650px; max-height: 600px; background: white; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); overflow: hidden; display: flex; flex-direction: column; } /* Encabezado del Chatbot */ #chatbot-header { background: #0078d4; color: white; padding: 15px; font-size: 18px; font-weight: bold; text-align: center; } /* Área de Mensajes */ #chatbot-messages { flex: 1; padding: 15px; overflow-y: auto; background: #f4f4f4; } /* Mensajes */ .message { margin: 10px 0; display: flex; align-items: flex-start; } .message.user { justify-content: flex-end; } .message.bot { justify-content: flex-start; } .message-content { max-width: 70%; padding: 10px 15px; border-radius: 8px; font-size: 16px; line-height: 1.5; } .message.user .message-content { background: #0078d4; color: white; } .message.bot .message-content { background: white; color: #333; border: 1px solid #ccc; } /* Entrada de Mensaje */ #chatbot-input-container { display: flex; padding: 10px; background: white; border-top: 1px solid #ccc; } #chatbot-input { flex: 1; padding: 10px; font-size: 16px; border: 1px solid #ccc; border-radius: 5px; outline: none; } #chatbot-send-btn { margin-left: 10px; padding: 10px 15px; font-size: 16px; background: #0078d4; color: white; border: none; border-radius: 5px; cursor: pointer; transition: background 0.3s ease; } #chatbot-send-btn:hover { background: #005bb5; } /* Accesibilidad */ #chatbot-input:focus, #chatbot-send-btn:focus { outline: 2px solid #0078d4; outline-offset: 2px; } @media (max-width: 600px) { #chatbot-container { width: 90%; right: 5%; bottom: 10px; } }
l
Hey @enough-dog-47566 Thank you for reaching out, Will get back to you!
🙂
w
are you using the full embed or are you using the chat bubble
@enough-dog-47566 you can add
Copy code
css
.bpContainer{
    width: 25vw;
}
to your webchat custom css
25vw is 25% view width which is 1/4 of the screen
e
Thanks for your reply, lads. I've changed the code and published the changes but still no response. It does change in the Bot Appearance menu but not in the integrated chat bubble
w
hi!! could you link me the website so i can check?
you can do it in dms if you prefer
e
Sure, let me DM
w
feel free to dm LOL
w
you don't need to change
.bpContainer
has width:100% of the container. Injected iframe is the container, I put these css on my site to open full-screen
Copy code
css
<style>
/**
 * BOTPRESS CUSTOM STYLES
 */
@media (min-width:768px) {
  .bpWebchat { width: 100% !important; height: 100% !important; right: 0 !important; bottom: 0 !important; max-height: 100% !important; overflow: auto !important; -webkit-overflow-scrolling: touch; }
}
</style>
w
yeah true
@enough-dog-47566 just add this to your site's custom css
Copy code
.bpWebchat {
    width: 25vw;
}
3 Views