Skip to content

Instantly share code, notes, and snippets.

@gavinblair
Created February 7, 2012 22:59
Show Gist options
  • Save gavinblair/1762726 to your computer and use it in GitHub Desktop.
Save gavinblair/1762726 to your computer and use it in GitHub Desktop.
"randomly" angled highlights
<p class='highlighted'>
<span>This is a line</span>
<span>This is a line</span>
<span>This is a line</span>
</p>
.highlighted {
font-weight: bold;
}
.highlighted span {
display: block;
line-height: 1.6em;
position: relative;
}
.highlighted span:after {
-moz-transform: rotate(2deg);
background: none repeat scroll 0 0 #1BB5F5;
content: "";
display: block;
height: 1em;
left: -0.5em;
padding: 0.3em 0;
position: absolute;
top: 0;
width: 100%;
z-index: -1;
}
.highlighted span:nth-child(2):after {
-moz-transform: rotate(-2deg);
}
.highlighted span:nth-child(3):after {
-moz-transform: rotate(3deg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment