box-skew
by Nic Fontaine
HTML
<h1>
H<span class='rot10'>e</span>ad<span class='rot180'>i</span>n<span class='rot5'>g</span>
<div>subheading</div>
</h1>
CSS
body {
font-family: Helvetica, Arial, sans-serif;
background: #fff;
margin: 0;
}
h1 {
margin: 40px;
padding: 0 7px 8px;
display: inline-block;
position: relative;
color: #444;
color: #C382E8;
font-size: 2.8em;
letter-spacing: -1px;
}
h1 span {
display: inline-block;
}
h1 .rot180 {
transform: rotate(182deg) translate(-1px,-5px);
}
h1 .rot10 {
transform: rotate(-10deg) translate(-2px,2px);
}
h1 .rot5 {
transform: rotate(-5deg) translate(0,-3px);
}
h1:before {
content: '';
position: absolute;
background: #fff;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: skew(0deg,1deg);
transform-origin: 50% 50%;
}
h1:after {
content: '';
position: absolute;
background: #D385ED;
z-index: -2;
top: -10px;
left: -10px;
right: -10px;
bottom: -12px;
transform: skew(1deg);
transform-origin: 50% 50%;
perspective: 300px;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#d385ed+0,ae7ce2+100 */
background: #d385ed; /* Old browsers */
background: -moz-linear-gradient(top, #d385ed 0%, #ae7ce2 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, #d385ed 0%,#ae7ce2 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, #d385ed 0%,#ae7ce2 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d385ed', endColorstr='#ae7ce2',GradientType=0 ); /* IE6-9 */
}
h1 > div {
font-size: 0.25em;
/* text-transform: uppercase; */
text-align: center;
font-family: Courier, 'Courier New', monospace;
color: #fff;
margin-top: 2px;
padding: 4px;
letter-spacing: 6px;
position: relative;
}
h1 > div:before {
content: '';
position: absolute;
background: #C382E8;
transform: matrix(1,0.02,0.02,1,0,0);
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform-origin: 50% 50%;
}