A CSS speech bubble is a rounded message surface with a border-built triangular tail, and a generator can create that shape without an image, SVG asset, or JavaScript.
For beginners, the CSS Speech Bubble Generator handles the repeatable geometry while leaving content and interaction to your component. You choose the colors, radius, tail size, and direction, inspect the live preview, and copy a class plus pseudo-element rule into your stylesheet.

The Controls and Their Limits
The generator focuses on the small set of properties that determine a basic speech-bubble shape. Knowing what each control changes helps you make an intentional choice before copying the result.
| Control | Accepted value | What it controls |
|---|---|---|
| Bubble color | One complete six-digit hex value | Sets the message surface and the colored border used for the triangular pointer. |
| Text color | One complete six-digit hex value | Sets the text color inside the bubble. |
| Corner radius | 0–80 px | Controls how much the bubble corners are rounded. |
| Tail size | 4–40 px | Controls the visible projection of the triangle and half of its base. |
| Tail direction | Top, right, bottom, or left | Selects the side where the pointer appears and centers it on that side. |
Both colors and the numeric controls are validated. An incomplete hexadecimal color is rejected, and an empty numeric field is rejected rather than being converted to zero. The focused output does not generate custom pointer offsets, multiple pointers, curved tails, outlines, or drop shadows.
Build Your First Bubble
- Choose the bubble and text colors. Enter each color as a complete six-digit hexadecimal value. Because the bubble color also fills the triangle, inspect the text against the bubble surface rather than assuming the preview establishes accessibility.
- Set the corner radius and tail size. Keep the radius within 0–80 px and the tail size within 4–40 px. Increasing the tail size enlarges both the pointer’s visible projection and half of its triangular base, so compare several sizes in the preview.
- Select the tail direction. Choose top, right, bottom, or left, then inspect the result. The preview uses a child element because inline styles cannot target pseudo-elements, but it applies the same validated size, color, side, and offset calculation as the production rule.
- Copy the CSS and integrate it. Paste the complete class and pseudo-element rule into your stylesheet, apply the generated class to the intended bubble, and then add content layout, semantics, contrast, and responsive spacing. The copied CSS intentionally omits content, padding, width, typography, animation, and interaction logic.
From Live Preview to Production CSS
The copied result uses a relatively positioned base class and an absolutely positioned ::after pseudo-element. The pseudo-element starts as a box with zero width and zero height. Adjacent borders receive transparent colors, while the border opposite the chosen side receives the bubble color. The generator writes explicit declarations so you can inspect the geometry in developer tools.
This technique depends on the way CSS draws border edges. MDN’s border-style reference explains the individual edge styles, while CSS Backgrounds and Borders Level 3 defines the underlying border behavior.
- For a bottom tail, the left and right border colors are transparent and the top border carries the bubble color. The pseudo-element sits below the bubble and is centered horizontally.
- For a top tail, the colored border reverses to the bottom edge, and the pseudo-element is positioned above the bubble.
- For a left tail, the top and bottom borders are transparent and the right border is colored. A right tail reverses that border arrangement.
- Left and right tails are centered vertically on their selected sides.
The tail is centered by default. After copying the rule, adjust its 50% positioning if the pointer should align with an avatar, button, or other anchor. Custom offsets are outside the generated output, so that final alignment is a deliberate manual edit.
Match HTML to the Bubble’s Purpose
The generated shape does not determine which HTML element should contain the message. Choose the structure according to the content’s meaning, then attach the generated class to that element.
| Use case | Appropriate starting point | Production requirement |
|---|---|---|
| Quotation | A paragraph containing the quoted content | Keep the quotation identifiable in the document’s reading order. |
| Chat message | A list item within an appropriate message list | Expose the author, order, status, and timestamps in text; left or right placement alone is not enough. |
| Interactive tooltip | A tooltip associated with its trigger | Add keyboard reachability, predictable dismissal, focus behavior, and an accessible relationship between trigger and tooltip. |
A triangular pointer is decorative and does not establish a semantic relationship by itself. Do not turn the generated box into a tooltip merely by adding a tail. For a chat interface, test the message list’s semantic reading order and make sure important details do not depend on color, position, or the pointer alone.
Make the Bubble Readable and Responsive
The generator does not calculate WCAG contrast ratios, so a visually pleasant pairing can still be difficult to read. Check the selected text and bubble colors directly, including the states used by your component.
- Give the component a sensible maximum width. Long unbroken strings, translated copy, browser zoom, and narrow mobile widths can make the bubble expand or collide with its tail.
- Add wrapping rules and padding. The shape should not be responsible for controlling how text flows through it.
- Reserve outer space on the tail side. The pointer extends beyond the bubble’s main box and needs room inside the surrounding layout.
- Inspect responsive breakpoints. Test the exact container that will host the bubble, along with high-contrast modes, zoom, and localized text.
- Use existing design tokens where appropriate. Reconcile the generated colors and dimensions with the spacing, typography, and color decisions already used by your project.
Check Tail Placement in the Real Layout
A pointer that looks correct in the preview can still be clipped or misaligned after the bubble enters a larger layout. Test the finished component rather than judging the shape in isolation.
- If the tail disappears, inspect ancestors for overflow: hidden and check whether the container provides enough outer space.
- If the pointer points at the wrong place, remember that it is centered on the selected side; adjust the copied 50% positioning for the intended anchor.
- If the bubble grows too wide, add a maximum width, wrapping behavior, and appropriate padding rather than enlarging the shape further.
- If the page differs from the preview, confirm that the generated class is applied and that the copied ::after rule is present in the active stylesheet.
All calculations happen locally and deterministically. Nothing is uploaded or retained, no account is required, and the generator introduces no new dependency. Those privacy and simplicity properties do not replace the final checks in your own layout, content, and accessibility test environment.
Related reading: CSS Stripes Generator Explained: Patterns, Periods, Pixels.
Related reading: Text Shadow Generator Example: Create One CSS Shadow.