Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordandobson/166736 to your computer and use it in GitHub Desktop.
Save jordandobson/166736 to your computer and use it in GitHub Desktop.
A Help / Chat bubble using only CSS + Unicode. No Images needed!
<html>
<head>
<title>Help / Chat Bubble with CSS + Unicode</title>
<!--
Created by: Jordan Robert Dobson
JordanDobson@Gmail.com
http://MadeBySquad.com
http://twitter.com/JordanDobson
-->
<style type="text/css">
body{
text-align: center;
margin: 5.0em 0;
font-family: sans-serif;
color: #ccc;
}
/* Bubble Specific CSS */
.bubble{
margin: 0 auto;
}
.bubble,
.bubble em{
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
position: relative;
background-color: #eee;
}
.bubble{
width: 200px;
display: block;
box-shadow: #999 1px 1px 1px;
-moz-box-shadow: #999 1px 1px 1px;
-webkit-box-shadow: #999 1px 1px 1px;
}
.bubble em{
display: block;
padding: 1.25em;
text-align: center;
z-index: 2;
color: #333;
font-size: .75em;
font-style: normal;
}
.bubble:before{
text-shadow: #999 1px 1px 1px;
color: #eee;
position: absolute;
text-align: center;
font-size: 1.5em;
width: 1.0em;
height: 1.0em;
line-height: 1.0em;
}
.left:before,
.right:before{
top: 50%;
margin-top: -.5em;
}
.top:before,
.bottom:before{
left: 50%;
margin-left: -.5em;
}
.top:before{
content: "\25B2";
top: -.5em;
}
.bottom:before{
content: "\25BC";
bottom: -.5em;
}
.left:before{
content: "\25C0";
left: -.5em;
}
.right:before{
content: "\25BA";
right: -.5em;
}
</style>
</head>
<body>
<div class="bubble bottom">
<em>Use for help along side form elements or for other things like chat bubbles. Change the div class to top, left, right, bottom to move the position of the arrow.</em>
</div>
<p>No images needed at all.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment