<div class="box speech-bottom success">
<em>Everything is</em><br/>
<strong style="font-size: 50px;">OK</strong>
</div>
<div class="box speech-bottom error speech-push-right">
<span style="font-size: 30px;">Oops!</span><br/>
Something <strong>wrong</strong> happened!
</div>
<div class="box speech-bottom">
Hi, I'm SpeechDiv Threepwood, <br/>
a mighty pirate!<br/>
<strong>Really!</strong>
</div>
<div class="box">
Here's what you need for a barrel of Grog:
<ul>
<li>Kerosene</li>
<li>Propylene Glycol</li>
<li>Artificial sweeteners</li>
<li>Sulphuric acid</li>
<li>Rum</li>
<li>Acetone</li>
<li>Red dye nº2</li>
<li>SCUMM</li>
<li>Axle grease</li>
<li>Batery acid</li>
</ul>
And/or
<ul>
<li>Pepperoni</li>
</ul>
</div>
@import "compass/css3";
/* apply a natural box layout model to all elements */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
body
{
background: #345;
}
.box.error
{
border-color: #922;
background: #922;
color: white;
}
.box.success
{
border-color: #292;
background: #292;
color: white;
}
.box
{
min-width: 50px;
min-height: 40px;
border-color: #CCC;
background-color: #CCC;
color: #555;
display: inline-block;
position: relative;
padding: 10px;
font-size: 13px;
margin: 20px;
border-radius: 10px;
box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.2),
inset -1px -1px 0px rgba(0, 0, 0, 0.6),
0 14px 6px -10px rgba(0, 0, 0, 0.3);
}
.speech-top:after
{
content: "";
position: absolute;
width: 0;
height: 0;
top: -19px;
left: 10px;
border: 10px solid;
border-color: transparent;
border-bottom-color: inherit;
}
.speech-bottom:after
{
content: "";
position: absolute;
width: 0px;
height: 0px;
top: 100%;
left: 10px;
margin-top: -2px;
border: 10px solid;
border-color: transparent;
border-top-color: inherit;
}
.speech-push-right:after
{
left: 100%;
margin-left: -30px;
}
View Compiled
$(document).ready(function(){
$('.box').each(function(){
var randDegrees = Math.round(Math.random()*40)-20;
$(this).css('transform','rotate('+randDegrees+'deg)');
});
});
This Pen doesn't use any external CSS resources.