Overview
You can show the CloseBot chat widget inside your page, not just as a bubble in the bottom-right corner. Add an empty container element where you want the chat to appear, and CloseBot loads the widget inside it.
Before you start
The CloseBot pixel must be installed on the page. Find it under Sources → your source → Copy Pixel.
Your website's domain must be listed in the source's Allowed Domains.
A widget must be set to show on this page. See Target (Page Filter) Settings.
Add the container
Place this element wherever you want the chat to appear:
<div id="cb-widget-container"></div>
When a widget is set to show on the page, CloseBot puts it inside this container instead of the bottom-right corner.
Put the container directly in your page's HTML. If a page builder or script adds it later, it needs to appear within about 2 seconds of the page loading. After that, the widget shows as the normal bottom-right bubble instead.
Note: only one widget can show per page. If more than one widget matches the page, CloseBot uses the first one in your widget list. See Creating and Ordering Widgets.
Sizing and placing the container
You control where the container sits and how big it is. The widget fills the container's full width and height.
Height: give the container a height. If you don't, it gets a minimum height of 420px.
Rounded corners: the embedded widget has square corners and no shadow, so it blends into your layout. For rounded corners, add border-radius and overflow: hidden to the container.
#cb-widget-container {
height: 500px;
border-radius: 12px;
overflow: hidden;
border: 1px solid #e5e7eb;
}
Colors and theme
Set your brand colour and light, dark or system theme in Chat Settings first. These settings apply to both the embedded widget and the bubble, and you don't need any code for them. Use custom CSS only for changes the settings don't cover.
Overriding CloseBot CSS
The widget is added straight into your page's HTML, so your own CSS can change any part of it. Inspect the widget in your browser to find the class you want. Every widget class starts with cb-. The main ones are:
Class | What it is |
.cb-header | The coloured bar at the top, with the name and close button |
.cb-messages | The scrolling message area |
.cb-msg-item | A single message |
.cb-footer | The bottom bar with the text box and send button |
.cb-input | The text box |
Add !important to your rules so they win over the widget's built-in styles.
For example, this hides the header on desktop only:
@media (min-width: 481px) {
#cb-widget-container .cb-header {
display: none !important;
}
}
Keep the header on phones. On small screens the embedded widget opens full screen, and the close button lives in the header. If you hide the header there, visitors have no way to close the chat.
On mobile
The embedded widget works on phones without any extra code. On screens 480px wide or smaller:
The widget stays in your container until the visitor taps the text box.
It then opens full screen, adjusting for the keyboard and the phone's notch, and the page behind it stops scrolling.
A close button appears in the header. Tapping it puts the widget back in your container.
You don't need to add your own fullscreen code or close button. If you added custom fullscreen code from an earlier version of this article, remove it, because it now clashes with the built-in behavior.
Summary
CloseBot is not responsible for teaching or answering CSS and Javascript questions. The examples given here on how to modify your embed experience are given to help you get started 😊


