Snippets

Simple CSS Speech Bubbles

Let's create some nice looking speac bubbles that can be used for comments or as design elements.

July 1, 2017

bubble comment

Simple CSS Speech Bubbles
Normal Bubble
Rounded Bubble
Different Color Bubble
Large Size Bubble
Everything Combined Bubble
<div class="speech-bubble x"> Normal Bubble </div> <div class="x"></div> <div class="speech-bubble rounded x"> Rounded Bubble </div> <div class="x"></div> <div class="speech-bubble blue x"> Different Color Bubble </div> <div class="x"></div> <div class="speech-bubble large x"> Large Size Bubble </div> <div class="x"></div> <div class="speech-bubble rounded large blue x"> Everything Combined Bubble </div> <div class="x"></div> .speech-bubble { clear: both; background: #ddd; color: #333; display: inline-block; font-size: 14px; line-height: 4em; margin-bottom: 45px; padding: 0 1em; position: relative; text-align: center; vertical-align: top; min-width: 7em; } .speech-bubble:after { border: 1em solid transparent; border-top-color: #ddd; content: ''; margin-left: -1em; position: absolute; top: 100%; left: 50%; width: 0; height: 0; } .speech-bubble.large { font-size: 2em; padding: 0 1em; min-width: 4em; } .speech-bubble.rounded { border-radius: .4em; } .speech-bubble.blue { background: #ddf; color: #334; } .speech-bubble.blue:after { border-top-color: #ddf; }

Related Content

Easy Way to Fix Anchor Links Scrolling Too Far

Stories

Easy Way to Fix Anchor Links Scrolling Too Far

Fixed navbar is a very popular way of displaying navigation when a page is scrolled, but you could run into a small detail that needs to be addressed.

How to Avoid Page Flickering When Scrollbars are Dynamically Shown or Hidden?

Stories

How to Avoid Page Flickering When Scrollbars are Dynamically Shown or Hidden?

There are certain cases when you want to dynamically manipulate the page height which will result in flickering.

Changing the Mouse Cursor in CSS With the cursor Property

Stories

Changing the Mouse Cursor in CSS With the cursor Property

Using CSS to change the cursor on your website is a great way to add a little bit of personality to your site.