Skip to content

Instantly share code, notes, and snippets.

@psd
Created February 6, 2010 13:38
Show Gist options
  • Save psd/296721 to your computer and use it in GitHub Desktop.
Save psd/296721 to your computer and use it in GitHub Desktop.
Pure CSS speech balloon
<html>
<head>
<style type="text/css">
.balloon {
margin: 1em auto;
font: normal 64px/0.9 Constantia,Palatino,"Palatino Linotype","Palatino LT STD","Times New Roman",serif;
width: 8em;
}
.balloon > div {
background: #222;
}
.balloon .content {
color: #fff;
line-height: 1.2em;
padding: 1em;
text-align:center;
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
}
.balloon .pointer {
height: 1em;
}
.balloon .pointer span {
background: #fff; /* body background */
width: 49%;
height: 100%;
}
.balloon .pointer .left {
-moz-border-radius-topright: 1em;
-webkit-border-top-right-radius: 1em;
float: left;
}
.balloon .pointer .right {
-moz-border-radius-topleft: 1em;
-webkit-border-top-left-radius: 1em;
float: right;
}
</style>
</head>
<body>
<div class="balloon">
<div class="content">The <em>Style</em> is a Balloon.</div>
<div class="pointer">
<span class="left"></span>
<span class="right"></span>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment