Skip to content

Instantly share code, notes, and snippets.

@hemantajax
Created September 14, 2012 07:35
Show Gist options
  • Save hemantajax/3720537 to your computer and use it in GitHub Desktop.
Save hemantajax/3720537 to your computer and use it in GitHub Desktop.
css tringles with css
<!doctype html>
<html>
<head>
<title>css tringles</title>
<meta charset="utf-8" />
<style>
.chat-bubble {
background-color:#EDEDED;
border:2px solid #ccc;
font-size:35px;
line-height:1.3em;
margin:50px auto;
padding:10px;
position:relative;
text-align:center;
width:300px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
-moz-box-shadow:0 0 5px #888888;
-webkit-box-shadow:0 0 5px #888888;
box-shadow: 0 0 4px #ccc;
}
.chat-bubble-arrow-border {
border-style: solid;
border-width: 10px;
height: 0;
left: 50%;
margin-left: -10px;
position: absolute;
width: 0;
}
.chat-bubble-arrow {
border-style: solid;
border-width: 10px;
height: 0;
left: 50%;
margin-left: -10px;
position: absolute;
width: 0;
}
.chat-bubble-arrow-border.top {
border-color: transparent transparent #ccc;
bottom: 103%;
}
.chat-bubble-arrow.top {
border-color: transparent transparent #EDEDED;
bottom: 99%;
}
.chat-bubble-arrow-border.bottom {
border-color: #ccc transparent transparent transparent;
bottom: -22px;
}
.chat-bubble-arrow.bottom {
border-color: #EDEDED transparent transparent transparent;
bottom: -19px;
}
.chat-bubble-arrow-border.left {
border-color: transparent #ccc transparent transparent;
left: -10px;
top: 37%;
}
.chat-bubble-arrow.left {
border-color: transparent #EDEDED transparent transparent;
left: -7px;
top: 37%;
}
.chat-bubble-arrow-border.right {
border-color: transparent transparent transparent #ccc;
left: 104%;
top: 37%;
}
.chat-bubble-arrow.right {
border-color: transparent transparent transparent #EDEDED;
left: 103%;
top: 37%;
}
</style>
</head>
<body>
<div class="chat-bubble">
Hello Hemant!
<div class="chat-bubble-arrow-border top"></div>
<div class="chat-bubble-arrow top"></div>
</div>
<div class="chat-bubble">
Hello Hemant!!
<div class="chat-bubble-arrow-border bottom"></div>
<div class="chat-bubble-arrow bottom"></div>
</div>
<div class="chat-bubble">
Hello Hemant!!
<div class="chat-bubble-arrow-border left"></div>
<div class="chat-bubble-arrow left"></div>
</div>
<div class="chat-bubble">
Hello Hemant!!
<div class="chat-bubble-arrow-border right"></div>
<div class="chat-bubble-arrow right"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment