Skip to content

Instantly share code, notes, and snippets.

@vitalyrotari
Last active August 29, 2015 14:02
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 vitalyrotari/d1e386363980764a975c to your computer and use it in GitHub Desktop.
Save vitalyrotari/d1e386363980764a975c to your computer and use it in GitHub Desktop.
CSS Highlighted Text
<p class="title" id="target">
<span class="highlight">
DEFAULT: This is how highlighted text usally wraps. It gets tight on the left and right edges.
</span>
</p>
$padding: 0.5rem;
$highlight: #ee4035;
.title {
font: 2.2rem/1.25 Ubuntu, sans-serif;
text-transform: uppercase;
margin-bottom: 1rem;
.highlight {
display: inline;
background: $highlight;
color: white;
padding: $padding;
padding-left: 0;
padding-right: 0;
box-shadow:
$padding 0 0 $highlight,
-$padding 0 0 $highlight;
}
}
html,
body {
background: #ccc;
text-align: center;
padding: 3%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment