Last active
August 29, 2015 14:02
-
-
Save vitalyrotari/d1e386363980764a975c to your computer and use it in GitHub Desktop.
CSS Highlighted Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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