CSS Speech Bubble Generator
Generate a CSS speech bubble with a tail pointing in any direction — built with pure CSS using ::after pseudo-element.
CSS generated is free to use — no attribution required.
How do CSS speech bubbles work?
A speech bubble is a styled div with a CSS triangle generated by the ::after pseudo-element positioned at the edge. The triangle uses the border trick: zero-size element with one colored border and two transparent borders.
What is the CSS speech bubble code structure?
The .bubble class styles the container (background, padding, border-radius). The .bubble::after rule creates the tail with content: "", position: absolute, width: 0, height: 0, and appropriate border properties.
How do you position the tail on a CSS speech bubble?
For a bottom tail: position the ::after element at bottom: -Xpx and use border-left, border-right, border-top to create a downward triangle. Adjust left percentage to move it horizontally.
What are the common use cases for CSS speech bubbles?
Speech bubbles are commonly used for tooltips, testimonials, chat interfaces, comic-style callouts, and tutorial overlays.